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.12 by greg, Wed Jul 29 18:11:23 2020 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  "paths.h"
13 + #include  "rtmath.h"
14 + #include  "rtio.h"
15 + #include  "rterror.h"
16   #include  "object.h"
11
17   #include  "otypes.h"
18 + #include  "oconv.h"
19  
14 #include  <ctype.h>
20  
21 < extern char  *fgetword();
21 > static void getobject2(char  *name, FILE  *fp, ro_cbfunc f);
22  
23 < readobj2(input, callback)       /* read in an object file or stream */
24 < char  *input;
25 < int  (*callback)();
23 >
24 > void
25 > readobj2(       /* read in an object file or stream */
26 >        char  *input,
27 >        ro_cbfunc callback
28 > )
29   {
22        FILE  *popen();
23        char  *fgetline();
30          FILE  *infp;
31 <        char  buf[512];
31 >        char  buf[2048];
32          register int  c;
33  
34          if (input == NULL) {
# Line 58 | Line 64 | int  (*callback)();
64   }
65  
66  
67 < getobject2(name, fp, f)                 /* read the next object */
68 < char  *name;
69 < FILE  *fp;
70 < int  (*f)();
67 > static void
68 > getobject2(                     /* read the next object */
69 >        char  *name,
70 >        FILE  *fp,
71 >        ro_cbfunc f
72 > )
73   {
74          char  sbuf[MAXSTR];
75          OBJREC  thisobj;
# Line 70 | Line 78 | int  (*f)();
78          thisobj.omod = OVOID;
79                                          /* get type */
80          fgetword(sbuf, MAXSTR, fp);
81 <        if (!strcmp(sbuf, ALIASID))
74 <                thisobj.otype = -1;
75 <        else if ((thisobj.otype = otype(sbuf)) < 0) {
81 >        if ((thisobj.otype = otype(sbuf)) < 0) {
82                  sprintf(errmsg, "(%s): unknown type \"%s\"", name, sbuf);
83                  error(USER, errmsg);
84          }
# Line 80 | Line 86 | int  (*f)();
86          fgetword(sbuf, MAXSTR, fp);
87          thisobj.oname = sbuf;
88                                          /* get arguments */
89 <        if (thisobj.otype == -1) {
89 >        if (thisobj.otype == MOD_ALIAS) {
90                  fscanf(fp, "%*s");
91                  return;
92          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines