1 |
< |
/* Copyright (c) 1995 Regents of the University of California */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ LBL" */ |
4 |
< |
|
1 |
> |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
* Header for programs that load variable files. |
4 |
|
*/ |
5 |
+ |
#ifndef _RAD_VARS_H_ |
6 |
+ |
#define _RAD_VARS_H_ |
7 |
+ |
#ifdef __cplusplus |
8 |
+ |
extern "C" { |
9 |
+ |
#endif |
10 |
|
|
11 |
< |
typedef struct { |
12 |
< |
char *name; /* variable name */ |
11 |
> |
typedef struct variable_s { |
12 |
> |
const char *name; /* variable name */ |
13 |
|
short nick; /* # characters required for nickname */ |
14 |
|
short nass; /* # assignments made */ |
15 |
|
char *value; /* assigned value(s) */ |
16 |
< |
int (*fixval)(); /* assignment checking function */ |
16 |
> |
void (*fixval)(struct variable_s *); /* assignment checking function */ |
17 |
|
} VARIABLE; /* a variable-value pair */ |
18 |
|
|
19 |
|
/**** The following variables should be declared by calling program ****/ |
28 |
|
|
29 |
|
/**** The rest is declared in loadvars.c ****/ |
30 |
|
|
29 |
– |
extern int onevalue(), catvalues(), boolvalue(), |
30 |
– |
qualvalue(), fltvalue(), intvalue(); |
31 |
– |
|
32 |
– |
extern VARIABLE *matchvar(); |
33 |
– |
extern char *nvalue(); |
34 |
– |
|
31 |
|
#define UPPER(c) ((c)&~0x20) /* ASCII trick */ |
32 |
|
|
33 |
|
#define vnam(vc) (vv[vc].name) |
42 |
|
#define HIGH 'H' |
43 |
|
#define MEDIUM 'M' |
44 |
|
#define LOW 'L' |
45 |
+ |
|
46 |
+ |
|
47 |
+ |
extern void loadvars(const char *rfname); |
48 |
+ |
extern int setvariable(const char *ass, VARIABLE *(*mv)(const char*)); |
49 |
+ |
extern VARIABLE *matchvar(const char *nam); |
50 |
+ |
extern char *nvalue(int vn, int n); |
51 |
+ |
extern void checkvalues(void); |
52 |
+ |
extern void onevalue(VARIABLE *vp); |
53 |
+ |
extern void catvalues(VARIABLE *vp); |
54 |
+ |
extern int badmatch(char *tv, char *cv); |
55 |
+ |
extern void boolvalue(VARIABLE *vp); |
56 |
+ |
extern void qualvalue(VARIABLE *vp); |
57 |
+ |
extern void intvalue(VARIABLE *vp); |
58 |
+ |
extern void fltvalue(VARIABLE *vp); |
59 |
+ |
extern void printvars(FILE *fp); |
60 |
+ |
|
61 |
+ |
#ifdef __cplusplus |
62 |
+ |
} |
63 |
+ |
#endif |
64 |
+ |
#endif /* _RAD_VARS_H_ */ |