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

Comparing ray/src/common/readobj.c (file contents):
Revision 1.6 by greg, Fri Jul 19 09:25:43 1991 UTC vs.
Revision 1.7 by greg, Mon Jul 22 11:48:04 1991 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  <ctype.h>
20  
21 + extern char  *fgetword(), *strcpy();
22 +
23   OBJREC  *objblock[MAXOBJBLK];           /* our objects */
24   OBJECT  nobjects = 0;                   /* # of objects */
25  
# Line 77 | Line 79 | FILE  *fp;
79                  error(SYSTEM, "out of object space");
80          objp = objptr(obj);
81                                          /* get modifier */
82 <        fscanf(fp, "%s", sbuf);
82 >        strcpy(sbuf, "EOF");
83 >        fgetword(sbuf, MAXSTR, fp);
84          if (!strcmp(sbuf, VOIDID))
85                  objp->omod = OVOID;
86          else if ((objp->omod = modifier(sbuf)) == OVOID) {
# Line 85 | Line 88 | FILE  *fp;
88                  error(USER, errmsg);
89          }
90                                          /* get type */
91 <        fscanf(fp, "%s", sbuf);
91 >        strcpy(sbuf, "EOF");
92 >        fgetword(sbuf, MAXSTR, fp);
93          if (!strcmp(sbuf, ALIASID))
94                  objp->otype = -1;
95          else if ((objp->otype = otype(sbuf)) < 0) {
# Line 93 | Line 97 | FILE  *fp;
97                  error(USER, errmsg);
98          }
99                                          /* get identifier */
100 <        fscanf(fp, "%s", sbuf);
100 >        sbuf[0] = '\0';
101 >        fgetword(sbuf, MAXSTR, fp);
102          objp->oname = savqstr(sbuf);
103                                          /* get arguments */
104          if (objp->otype == -1) {
105                  register OBJECT  alias;
106 <                fscanf(fp, "%s", sbuf);
106 >                strcpy(sbuf, "EOF");
107 >                fgetword(sbuf, MAXSTR, fp);
108                  if ((alias = modifier(sbuf)) == OVOID) {
109                          sprintf(errmsg,
110                          "(%s): bad reference \"%s\" for %s \"%s\"",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines