ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/vars.h
Revision: 2.8
Committed: Mon Jun 5 16:09:55 2023 UTC (23 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.7: +5 -7 lines
Log Message:
fix: Updated with const char * type where appropriate

File Contents

# User Rev Content
1 greg 2.8 /* RCSid $Id: vars.h,v 2.7 2003/07/30 10:11:06 schorsch 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.3
11 schorsch 2.7 typedef struct variable_s {
12 greg 2.8 const char *name; /* variable name */
13 greg 2.1 short nick; /* # characters required for nickname */
14     short nass; /* # assignments made */
15     char *value; /* assigned value(s) */
16 schorsch 2.7 void (*fixval)(struct variable_s *); /* assignment checking function */
17 greg 2.1 } VARIABLE; /* a variable-value pair */
18    
19     /**** The following variables should be declared by calling program ****/
20    
21     extern int NVARS; /* total number of variables */
22    
23     extern VARIABLE vv[]; /* variable-value pairs */
24    
25     extern char *progname; /* global argv[0] from main */
26    
27     extern int nowarn; /* global boolean to turn warnings off */
28    
29     /**** The rest is declared in loadvars.c ****/
30    
31     extern VARIABLE *matchvar();
32     extern char *nvalue();
33    
34     #define UPPER(c) ((c)&~0x20) /* ASCII trick */
35    
36     #define vnam(vc) (vv[vc].name)
37     #define vdef(vc) (vv[vc].nass)
38     #define vval(vc) (vv[vc].value)
39     #define vint(vc) atoi(vval(vc))
40 greg 2.2 #define vflt(vc) atof(vval(vc))
41 greg 2.1 #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'
48 greg 2.3
49    
50 greg 2.8 extern void loadvars(const char *rfname);
51     extern int setvariable(const char *ass, VARIABLE *(*mv)(const char*));
52     extern VARIABLE *matchvar(const char *nam);
53 greg 2.3 extern char *nvalue(int vn, int n);
54     extern void checkvalues(void);
55     extern void onevalue(VARIABLE *vp);
56     extern void catvalues(VARIABLE *vp);
57     extern int badmatch(char *tv, char *cv);
58     extern void boolvalue(VARIABLE *vp);
59     extern void qualvalue(VARIABLE *vp);
60     extern void intvalue(VARIABLE *vp);
61     extern void fltvalue(VARIABLE *vp);
62     extern void printvars(FILE *fp);
63    
64 schorsch 2.5 #ifdef __cplusplus
65     }
66 greg 2.3 #endif
67 schorsch 2.5 #endif /* _RAD_VARS_H_ */