| 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 |
+ |
#include "copyright.h" |
| 12 |
+ |
|
| 13 |
|
typedef struct { |
| 14 |
|
char *name; /* variable name */ |
| 15 |
|
short nick; /* # characters required for nickname */ |
| 16 |
|
short nass; /* # assignments made */ |
| 17 |
|
char *value; /* assigned value(s) */ |
| 18 |
< |
int (*fixval)(); /* assignment checking function */ |
| 18 |
> |
void (*fixval)(); /* assignment checking function */ |
| 19 |
|
} VARIABLE; /* a variable-value pair */ |
| 20 |
|
|
| 21 |
|
/**** The following variables should be declared by calling program ****/ |
| 30 |
|
|
| 31 |
|
/**** The rest is declared in loadvars.c ****/ |
| 32 |
|
|
| 29 |
– |
extern int onevalue(), catvalues(), boolvalue(), |
| 30 |
– |
qualvalue(), fltvalue(), intvalue(); |
| 31 |
– |
|
| 33 |
|
extern VARIABLE *matchvar(); |
| 34 |
|
extern char *nvalue(); |
| 35 |
|
|
| 39 |
|
#define vdef(vc) (vv[vc].nass) |
| 40 |
|
#define vval(vc) (vv[vc].value) |
| 41 |
|
#define vint(vc) atoi(vval(vc)) |
| 42 |
+ |
#define vflt(vc) atof(vval(vc)) |
| 43 |
|
#define vlet(vc) UPPER(vval(vc)[0]) |
| 44 |
|
#define vscale vlet |
| 45 |
|
#define vbool(vc) (vlet(vc)=='T') |
| 47 |
|
#define HIGH 'H' |
| 48 |
|
#define MEDIUM 'M' |
| 49 |
|
#define LOW 'L' |
| 50 |
+ |
|
| 51 |
+ |
|
| 52 |
+ |
extern void loadvars(char *rfname); |
| 53 |
+ |
extern int setvariable(char *ass, VARIABLE *(*mv)()); |
| 54 |
+ |
extern VARIABLE *matchvar(char *nam); |
| 55 |
+ |
extern char *nvalue(int vn, int n); |
| 56 |
+ |
extern void checkvalues(void); |
| 57 |
+ |
extern void onevalue(VARIABLE *vp); |
| 58 |
+ |
extern void catvalues(VARIABLE *vp); |
| 59 |
+ |
extern int badmatch(char *tv, char *cv); |
| 60 |
+ |
extern void boolvalue(VARIABLE *vp); |
| 61 |
+ |
extern void qualvalue(VARIABLE *vp); |
| 62 |
+ |
extern void intvalue(VARIABLE *vp); |
| 63 |
+ |
extern void fltvalue(VARIABLE *vp); |
| 64 |
+ |
extern void printvars(FILE *fp); |
| 65 |
+ |
|
| 66 |
+ |
|
| 67 |
+ |
#ifdef __cplusplus |
| 68 |
+ |
} |
| 69 |
+ |
#endif |
| 70 |
+ |
#endif /* _RAD_VARS_H_ */ |
| 71 |
+ |
|