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

Comparing ray/src/util/eplus_idf.h (file contents):
Revision 2.1 by greg, Sat Feb 1 01:28:43 2014 UTC vs.
Revision 2.8 by schorsch, Sun Mar 6 01:13:18 2016 UTC

# Line 10 | Line 10
10   #ifndef _RAD_EPLUS_IDF_H_
11   #define _RAD_EPLUS_IDF_H_
12  
13 + #include "platform.h"
14   #include "lookup.h"
15  
16   #ifdef __cplusplus
# Line 17 | Line 18 | extern "C" {
18   #endif
19  
20   #define IDF_MAXLINE     512                     /* maximum line length */
21 < #define IDF_MAXARGL     128                     /* maximum argument length */
21 > #define IDF_MAXARGL     104                     /* maximum argument length */
22  
23 < /* Input Data File parameter argument list */
23 > /* Input Data File object argument list */
24   typedef struct s_idf_field {
25 <        struct s_idf_field      *next;          /* next in parameter list */
25 >        struct s_idf_field      *next;          /* next in object list */
26          char                    *rem;           /* string following argument */
27 <        char                    arg[2];         /* argument (extends struct) */
27 >        char                    val[2];         /* value (extends struct) */
28   } IDF_FIELD;
29  
30 < /* Input Data File parameter */
31 < typedef struct s_idf_parameter {
32 <        const char              *pname;         /* parameter name (type) */
33 <        struct s_idf_parameter  *pnext;         /* next parameter same type */
34 <        struct s_idf_parameter  *dnext;         /* next parameter in IDF */
30 > /* Input Data File object */
31 > typedef struct s_idf_object {
32 >        const char              *pname;         /* object name (type) */
33 >        struct s_idf_object     *pnext;         /* next object same type */
34 >        struct s_idf_object     *dnext;         /* next object in IDF */
35 >        int                     nfield;         /* field count */
36          IDF_FIELD               *flist;         /* field list */
37          char                    rem[1];         /* comment (extends struct) */
38 < } IDF_PARAMETER;
38 > } IDF_OBJECT;
39  
40   /* Input Data File w/ dictionary */
41   typedef struct {
42          char                    *hrem;          /* header remarks */
43 <        IDF_PARAMETER           *pfirst;        /* first parameter in file */
44 <        IDF_PARAMETER           *plast;         /* last parameter loaded */
45 <        LUTAB                   ptab;           /* parameter table */
43 >        IDF_OBJECT              *pfirst;        /* first object in file */
44 >        IDF_OBJECT              *plast;         /* last object loaded */
45 >        LUTAB                   ptab;           /* object hash table */
46   } IDF_LOADED;
47  
48 < /* Create a new parameter with empty field list (comment optional) */
49 < extern IDF_PARAMETER    *idf_newparam(IDF_LOADED *idf, const char *pname,
50 <                                                        const char *comm,
49 <                                                IDF_PARAMETER *prev);
48 > /* Create a new object with empty field list (comment & prev optional) */
49 > extern IDF_OBJECT       *idf_newobject(IDF_LOADED *idf, const char *pname,
50 >                                        const char *comm, IDF_OBJECT *prev);
51  
52 < /* Add a field to the given parameter and follow with the given text */
53 < extern int              idf_addfield(IDF_PARAMETER *param, const char *fval,
52 > /* Add a field to the given object and follow with the given text */
53 > extern int              idf_addfield(IDF_OBJECT *param, const char *fval,
54                                                          const char *comm);
55  
56 < /* Delete the specified parameter from our IDF */
57 < extern int              idf_delparam(IDF_LOADED *idf, IDF_PARAMETER *param);
56 > /* Retrieve the indexed field from object (first field index is 1) */
57 > extern IDF_FIELD        *idf_getfield(IDF_OBJECT *param, int fn);
58  
59 < /* Get a named parameter list */
60 < extern IDF_PARAMETER    *idf_getparam(IDF_LOADED *idf, const char *pname);
59 > /* Delete the specified object from the IDF */
60 > extern int              idf_delobject(IDF_LOADED *idf, IDF_OBJECT *param);
61  
62 < /* Read a parameter and fields from an open file and add to end of list */
63 < extern IDF_PARAMETER    *idf_readparam(IDF_LOADED *idf, FILE *fp);
62 > /* Move the specified object to the given position in the IDF */
63 > extern int              idf_movobject(IDF_LOADED *idf, IDF_OBJECT *param,
64 >                                                IDF_OBJECT *prev);
65  
66 + /* Get a named object list */
67 + extern IDF_OBJECT       *idf_getobject(IDF_LOADED *idf, const char *pname);
68 +
69 + /* Read a object and fields from an open file and add to end of list */
70 + extern IDF_OBJECT       *idf_readobject(IDF_LOADED *idf, FILE *fp);
71 +
72   /* Initialize an IDF struct */
73   extern IDF_LOADED       *idf_create(const char *hdrcomm);
74  
75 + /* Add comment(s) to header */
76 + extern int              idf_add2hdr(IDF_LOADED *idf, const char *hdrcomm);
77 +
78   /* Load an Input Data File */
79   extern IDF_LOADED       *idf_load(const char *fname);
80  
81 < /* Write a parameter and fields to an open file */
82 < int                     idf_writeparam(IDF_PARAMETER *param, FILE *fp);
81 > /* Write a object and fields to an open file */
82 > int                     idf_writeparam(IDF_OBJECT *param, FILE *fp,
83 >                                        int incl_comm);
84  
85   /* Write out an Input Data File */
86 < extern int              idf_write(IDF_LOADED *idf, const char *fname);
86 > extern int              idf_write(IDF_LOADED *idf, const char *fname,
87 >                                        int incl_comm);
88  
89   /* Free a loaded IDF */
90   extern void             idf_free(IDF_LOADED *idf);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines