--- ray/src/common/vars.h 1995/12/12 13:26:35 2.1 +++ ray/src/common/vars.h 2003/06/06 16:38:47 2.5 @@ -1,17 +1,21 @@ -/* Copyright (c) 1995 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid $Id: vars.h,v 2.5 2003/06/06 16:38:47 schorsch Exp $ */ /* * Header for programs that load variable files. */ +#ifndef _RAD_VARS_H_ +#define _RAD_VARS_H_ +#ifdef __cplusplus +extern "C" { +#endif +#include "copyright.h" + typedef struct { 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)(); /* assignment checking function */ } VARIABLE; /* a variable-value pair */ /**** The following variables should be declared by calling program ****/ @@ -26,9 +30,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(); @@ -38,6 +39,7 @@ extern char *nvalue(); #define vdef(vc) (vv[vc].nass) #define vval(vc) (vv[vc].value) #define vint(vc) atoi(vval(vc)) +#define vflt(vc) atof(vval(vc)) #define vlet(vc) UPPER(vval(vc)[0]) #define vscale vlet #define vbool(vc) (vlet(vc)=='T') @@ -45,3 +47,25 @@ extern char *nvalue(); #define HIGH 'H' #define MEDIUM 'M' #define LOW 'L' + + +extern void loadvars(char *rfname); +extern int setvariable(char *ass, VARIABLE *(*mv)()); +extern VARIABLE *matchvar(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_ */ +