ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/vars.h
(Generate patch)

Comparing ray/src/common/vars.h (file contents):
Revision 2.1 by greg, Tue Dec 12 13:26:35 1995 UTC vs.
Revision 2.12 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1995 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   *  Header for programs that load variable files.
4   */
5 + #ifndef _RAD_VARS_H_
6 + #define _RAD_VARS_H_
7 + #ifdef __cplusplus
8 + extern "C" {
9 + #endif
10  
11 < typedef struct {
12 <        char    *name;          /* variable name */
11 > typedef struct variable_s {
12 >        const char      *name;  /* variable name */
13          short   nick;           /* # characters required for nickname */
14          short   nass;           /* # assignments made */
15          char    *value;         /* assigned value(s) */
16 <        int     (*fixval)();    /* assignment checking function */
16 >        void    (*fixval)(struct variable_s *); /* assignment checking function */
17   } VARIABLE;             /* a variable-value pair */
18  
19   /**** The following variables should be declared by calling program ****/
# Line 20 | Line 22 | extern int     NVARS;          /* total number of variables */
22  
23   extern VARIABLE vv[];           /* variable-value pairs */
24  
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
29   #define UPPER(c)        ((c)&~0x20)     /* ASCII trick */
30  
31   #define vnam(vc)        (vv[vc].name)
32   #define vdef(vc)        (vv[vc].nass)
33   #define vval(vc)        (vv[vc].value)
34   #define vint(vc)        atoi(vval(vc))
35 + #define vflt(vc)        atof(vval(vc))
36   #define vlet(vc)        UPPER(vval(vc)[0])
37   #define vscale          vlet
38   #define vbool(vc)       (vlet(vc)=='T')
# Line 45 | Line 40 | extern char    *nvalue();
40   #define HIGH            'H'
41   #define MEDIUM          'M'
42   #define LOW             'L'
43 +
44 +
45 + extern void     loadvars(const char *rfname);
46 + extern int      setvariable(const char *ass, VARIABLE *(*mv)(const char*));
47 + extern VARIABLE *matchvar(const char *nam);
48 + extern char     *nvalue(int vn, int n);
49 + extern void     checkvalues(void);
50 + extern void     onevalue(VARIABLE *vp);
51 + extern void     catvalues(VARIABLE *vp);
52 + extern int      badmatch(char *tv, char *cv);
53 + extern void     boolvalue(VARIABLE *vp);
54 + extern void     qualvalue(VARIABLE *vp);
55 + extern void     strvalue(VARIABLE *vp);
56 + extern void     intvalue(VARIABLE *vp);
57 + extern void     fltvalue(VARIABLE *vp);
58 + extern int      singlevar(VARIABLE *vp);
59 + extern void     printvars(FILE *fp);
60 +
61 + #ifdef __cplusplus
62 + }
63 + #endif
64 + #endif /* _RAD_VARS_H_ */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines