ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/ot/readobj2.c
(Generate patch)

Comparing ray/src/ot/readobj2.c (file contents):
Revision 2.4 by greg, Sat Feb 22 02:07:26 2003 UTC vs.
Revision 2.8 by schorsch, Mon Oct 27 10:29:29 2003 UTC

# Line 5 | Line 5 | static const char      RCSid[] = "$Id$";
5   *  readobj2.c - routines for reading in object descriptions.
6   */
7  
8 < #include  "standard.h"
8 > #include  <ctype.h>
9 > #include  <stdio.h>
10  
11 + #include  "platform.h"
12 + #include  "rtprocess.h"
13 + #include  "rtmath.h"
14 + #include  "rtio.h"
15 + #include  "rterror.h"
16   #include  "object.h"
11
17   #include  "otypes.h"
18  
14 #include  <ctype.h>
19  
20 < extern char  *fgetword();
20 > static void getobject2(char  *name, FILE  *fp, int  (*f)());
21  
22   readobj2(input, callback)       /* read in an object file or stream */
23   char  *input;
24   int  (*callback)();
25   {
22        FILE  *popen();
26          char  *fgetline();
27          FILE  *infp;
28          char  buf[512];
# Line 58 | Line 61 | int  (*callback)();
61   }
62  
63  
64 < getobject2(name, fp, f)                 /* read the next object */
65 < char  *name;
66 < FILE  *fp;
67 < int  (*f)();
64 > static void
65 > getobject2(                     /* read the next object */
66 > char  *name,
67 > FILE  *fp,
68 > int  (*f)()
69 > )
70   {
71          char  sbuf[MAXSTR];
72          OBJREC  thisobj;
# Line 70 | Line 75 | int  (*f)();
75          thisobj.omod = OVOID;
76                                          /* get type */
77          fgetword(sbuf, MAXSTR, fp);
78 <        if (!strcmp(sbuf, ALIASID))
74 <                thisobj.otype = -1;
75 <        else if ((thisobj.otype = otype(sbuf)) < 0) {
78 >        if ((thisobj.otype = otype(sbuf)) < 0) {
79                  sprintf(errmsg, "(%s): unknown type \"%s\"", name, sbuf);
80                  error(USER, errmsg);
81          }
# Line 80 | Line 83 | int  (*f)();
83          fgetword(sbuf, MAXSTR, fp);
84          thisobj.oname = sbuf;
85                                          /* get arguments */
86 <        if (thisobj.otype == -1) {
86 >        if (thisobj.otype == MOD_ALIAS) {
87                  fscanf(fp, "%*s");
88                  return;
89          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines