--- ray/src/common/vars.h 1996/01/05 14:42:13 2.2 +++ ray/src/common/vars.h 2023/06/09 22:52:47 2.9 @@ -1,17 +1,19 @@ -/* Copyright (c) 1995 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid $Id: vars.h,v 2.9 2023/06/09 22:52:47 greg Exp $ */ /* * Header for programs that load variable files. */ +#ifndef _RAD_VARS_H_ +#define _RAD_VARS_H_ +#ifdef __cplusplus +extern "C" { +#endif -typedef struct { - char *name; /* variable name */ +typedef struct variable_s { + const char *name; /* variable name */ short nick; /* # characters required for nickname */ short nass; /* # assignments made */ char *value; /* assigned value(s) */ - int (*fixval)(); /* assignment checking function */ + void (*fixval)(struct variable_s *); /* assignment checking function */ } VARIABLE; /* a variable-value pair */ /**** The following variables should be declared by calling program ****/ @@ -26,12 +28,6 @@ extern int nowarn; /* global boolean to turn warnings /**** The rest is declared in loadvars.c ****/ -extern int onevalue(), catvalues(), boolvalue(), - qualvalue(), fltvalue(), intvalue(); - -extern VARIABLE *matchvar(); -extern char *nvalue(); - #define UPPER(c) ((c)&~0x20) /* ASCII trick */ #define vnam(vc) (vv[vc].name) @@ -46,3 +42,23 @@ extern char *nvalue(); #define HIGH 'H' #define MEDIUM 'M' #define LOW 'L' + + +extern void loadvars(const char *rfname); +extern int setvariable(const char *ass, VARIABLE *(*mv)(const char*)); +extern VARIABLE *matchvar(const char *nam); +extern char *nvalue(int vn, int n); +extern void checkvalues(void); +extern void onevalue(VARIABLE *vp); +extern void catvalues(VARIABLE *vp); +extern int badmatch(char *tv, char *cv); +extern void boolvalue(VARIABLE *vp); +extern void qualvalue(VARIABLE *vp); +extern void intvalue(VARIABLE *vp); +extern void fltvalue(VARIABLE *vp); +extern void printvars(FILE *fp); + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_VARS_H_ */