aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/sensfunc/sfmarks.x
blob: 39d85af6b09b258656698eebd8564e3015f1b270 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
include	<gset.h>
include	"sensfunc.h"

define	GMTYPES	"|point|box|plus|cross|diamond|hline|vline|hebar|vebar|circle|"


# SF_MARKS -- Decode user mark types into GIO mark types.  The input string
# consists of two whitespace separated mark types.

procedure sf_marks (gp, marks)

pointer	gp
char	marks[ARB]

int	i, nscan(), strdic()
pointer	sp, str

int	gmtypes[10]
data	gmtypes /GM_POINT,GM_BOX,GM_PLUS,GM_CROSS,GM_DIAMOND,GM_HLINE,GM_VLINE,
		GM_HEBAR,GM_VEBAR,GM_CIRCLE/

begin
	call smark (sp)
	call salloc (str, SZ_LINE, TY_CHAR)
	call sscan (marks)
	call gargwrd (Memc[str], SZ_LINE)
	if (nscan() == 1) {
	    i = strdic (Memc[str], Memc[str], SZ_LINE, GMTYPES)
	    if (i != 0)
		GP_MARK(gp) = gmtypes[i]
	}
	call gargwrd (Memc[str], SZ_LINE)
	if (nscan() == 2) {
	    i = strdic (Memc[str], Memc[str], SZ_LINE, GMTYPES)
	    if (i != 0)
		GP_MDEL(gp) = gmtypes[i]
	}
	call gargwrd (Memc[str], SZ_LINE)
	if (nscan() == 3) {
	    i = strdic (Memc[str], Memc[str], SZ_LINE, GMTYPES)
	    if (i != 0)
		GP_MADD(gp) = gmtypes[i]
	}

	call sfree (sp)
end