ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cv/trans.h
Revision: 2.4
Committed: Sat Nov 15 17:54:06 2003 UTC (20 years, 11 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3
Changes since 2.3: +6 -1 lines
Log Message:
Continued ANSIfication and reduced compile warnings.

File Contents

# User Rev Content
1 schorsch 2.4 /* RCSid: $Id: trans.h,v 2.3 2003/06/07 01:10:23 schorsch Exp $ */
2 greg 1.1 /*
3     * Translator definitions
4     *
5     * Greg Ward
6     */
7 schorsch 2.3 #ifndef _RAD_TRANS_H_
8     #define _RAD_TRANS_H_
9     #ifdef __cplusplus
10     extern "C" {
11     #endif
12    
13 greg 1.1
14     #define MAXSTR 128 /* maximum input string length */
15    
16     #define VOIDID "void" /* null modifier */
17    
18     /* qualifier list */
19     typedef struct {
20     int nquals; /* number of qualifiers */
21     char **qual; /* qualifier array */
22     } QLIST;
23     /* identifier */
24     typedef struct {
25     char *name; /* string, NULL if number */
26     int number;
27     } ID;
28     /* identifier list */
29     typedef struct {
30     int nids; /* number of ids */
31     ID *id; /* id array */
32     } IDLIST;
33     /* identifier range */
34     typedef struct {
35     char *nam; /* string, NULL if range */
36     int min, max; /* accepted range */
37     } IDMATCH;
38     /* mapping rule */
39     typedef struct rule {
40     char *mnam; /* material name */
41     long qflg; /* qualifier condition flags */
42     struct rule *next; /* next rule in mapping */
43     /* followed by the IDMATCH array */
44     } RULEHD;
45     /* useful macros */
46     #define doneid(idp) if ((idp)->name != NULL) freestr((idp)->name)
47     #define FL(qn) (1L<<(qn))
48     #define rulsiz(nq) (sizeof(RULEHD)+(nq)*sizeof(IDMATCH))
49     #define idm(rp) ((IDMATCH *)((rp)+1))
50    
51 schorsch 2.3
52     /* defined in common/savestr.c - XXX one of several declarations */
53     char *savestr(char *str);
54     /* defined in trans.c */
55     RULEHD *getmapping(char *file, QLIST *qlp);
56 schorsch 2.4
57     extern int fgetid(ID *idp, char *dls, FILE *fp);
58     extern int findid(IDLIST *idl, ID *idp, int insert);
59     extern int matchid(ID *it, IDMATCH *im);
60     extern void write_quals(QLIST *qlp, IDLIST idl[], FILE *fp);
61 schorsch 2.3
62    
63     #ifdef __cplusplus
64     }
65     #endif
66     #endif /* _RAD_TRANS_H_ */
67