ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/vars.h
Revision: 2.5
Committed: Fri Jun 6 16:38:47 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 2.4: +11 -18 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 schorsch 2.5 /* RCSid $Id: vars.h,v 2.4 2003/02/25 02:47:22 greg Exp $ */
2 greg 2.1 /*
3     * Header for programs that load variable files.
4     */
5 schorsch 2.5 #ifndef _RAD_VARS_H_
6     #define _RAD_VARS_H_
7     #ifdef __cplusplus
8     extern "C" {
9     #endif
10 greg 2.1
11 greg 2.4 #include "copyright.h"
12 greg 2.3
13 greg 2.1 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 greg 2.3 void (*fixval)(); /* assignment checking function */
19 greg 2.1 } VARIABLE; /* a variable-value pair */
20    
21     /**** The following variables should be declared by calling program ****/
22    
23     extern int NVARS; /* total number of variables */
24    
25     extern VARIABLE vv[]; /* variable-value pairs */
26    
27     extern char *progname; /* global argv[0] from main */
28    
29     extern int nowarn; /* global boolean to turn warnings off */
30    
31     /**** The rest is declared in loadvars.c ****/
32    
33     extern VARIABLE *matchvar();
34     extern char *nvalue();
35    
36     #define UPPER(c) ((c)&~0x20) /* ASCII trick */
37    
38     #define vnam(vc) (vv[vc].name)
39     #define vdef(vc) (vv[vc].nass)
40     #define vval(vc) (vv[vc].value)
41     #define vint(vc) atoi(vval(vc))
42 greg 2.2 #define vflt(vc) atof(vval(vc))
43 greg 2.1 #define vlet(vc) UPPER(vval(vc)[0])
44     #define vscale vlet
45     #define vbool(vc) (vlet(vc)=='T')
46    
47     #define HIGH 'H'
48     #define MEDIUM 'M'
49     #define LOW 'L'
50 greg 2.3
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 schorsch 2.5
67     #ifdef __cplusplus
68     }
69 greg 2.3 #endif
70 schorsch 2.5 #endif /* _RAD_VARS_H_ */
71