| 1 | 
greg | 
2.1 | 
/* Copyright (c) 1995 Regents of the University of California */ | 
| 2 | 
  | 
  | 
 | 
| 3 | 
  | 
  | 
/* SCCSid "$SunId$ LBL" */ | 
| 4 | 
  | 
  | 
 | 
| 5 | 
  | 
  | 
/* | 
| 6 | 
  | 
  | 
 *  Header for programs that load variable files. | 
| 7 | 
  | 
  | 
 */ | 
| 8 | 
  | 
  | 
 | 
| 9 | 
  | 
  | 
typedef struct { | 
| 10 | 
  | 
  | 
        char    *name;          /* variable name */ | 
| 11 | 
  | 
  | 
        short   nick;           /* # characters required for nickname */ | 
| 12 | 
  | 
  | 
        short   nass;           /* # assignments made */ | 
| 13 | 
  | 
  | 
        char    *value;         /* assigned value(s) */ | 
| 14 | 
  | 
  | 
        int     (*fixval)();    /* assignment checking function */ | 
| 15 | 
  | 
  | 
} VARIABLE;             /* a variable-value pair */ | 
| 16 | 
  | 
  | 
 | 
| 17 | 
  | 
  | 
/**** The following variables should be declared by calling program ****/ | 
| 18 | 
  | 
  | 
 | 
| 19 | 
  | 
  | 
extern int      NVARS;          /* total number of variables */ | 
| 20 | 
  | 
  | 
 | 
| 21 | 
  | 
  | 
extern VARIABLE vv[];           /* variable-value pairs */ | 
| 22 | 
  | 
  | 
 | 
| 23 | 
  | 
  | 
extern char     *progname;      /* global argv[0] from main */ | 
| 24 | 
  | 
  | 
 | 
| 25 | 
  | 
  | 
extern int      nowarn;         /* global boolean to turn warnings off */ | 
| 26 | 
  | 
  | 
 | 
| 27 | 
  | 
  | 
/**** The rest is declared in loadvars.c ****/ | 
| 28 | 
  | 
  | 
 | 
| 29 | 
  | 
  | 
extern int      onevalue(), catvalues(), boolvalue(), | 
| 30 | 
  | 
  | 
                qualvalue(), fltvalue(), intvalue(); | 
| 31 | 
  | 
  | 
 | 
| 32 | 
  | 
  | 
extern VARIABLE *matchvar(); | 
| 33 | 
  | 
  | 
extern char     *nvalue(); | 
| 34 | 
  | 
  | 
 | 
| 35 | 
  | 
  | 
#define UPPER(c)        ((c)&~0x20)     /* ASCII trick */ | 
| 36 | 
  | 
  | 
 | 
| 37 | 
  | 
  | 
#define vnam(vc)        (vv[vc].name) | 
| 38 | 
  | 
  | 
#define vdef(vc)        (vv[vc].nass) | 
| 39 | 
  | 
  | 
#define vval(vc)        (vv[vc].value) | 
| 40 | 
  | 
  | 
#define vint(vc)        atoi(vval(vc)) | 
| 41 | 
  | 
  | 
#define vlet(vc)        UPPER(vval(vc)[0]) | 
| 42 | 
  | 
  | 
#define vscale          vlet | 
| 43 | 
  | 
  | 
#define vbool(vc)       (vlet(vc)=='T') | 
| 44 | 
  | 
  | 
 | 
| 45 | 
  | 
  | 
#define HIGH            'H' | 
| 46 | 
  | 
  | 
#define MEDIUM          'M' | 
| 47 | 
  | 
  | 
#define LOW             'L' |