aboutsummaryrefslogtreecommitdiff
path: root/pkg/xtools/clginterp.x
blob: c65d69caaa9ed0ea59f7af3aedda649e798cd0e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include <math/iminterp.h>

# CLGINTERP -- Select an interpolator from a CL input string.  The procedure
# is coded to be protected from changes in the values of the interpolator
# types in interpdef.h.

int procedure clginterp (param)

char	param[ARB]		# CL parameter prompt string
int	index, iicodes[5]
pointer	sp, word
int	clgwrd()
errchk	clgwrd
data	iicodes /II_NEAREST, II_LINEAR, II_POLY3, II_POLY5, II_SPLINE3/

begin
	call smark (sp)
	call salloc (word, SZ_FNAME, TY_CHAR)

	index = max (1, min (5, clgwrd (param, Memc[word], SZ_FNAME,
	    "|nearest|linear|poly3|poly5|spline3|")))

	call sfree (sp)
	return (iicodes[index])
end