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.1 by greg, Thu Feb 2 10:34:39 1989 UTC vs.
Revision 1.5 by greg, Tue Sep 18 09:53:35 1990 UTC

# Line 19 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19   #include  <ctype.h>
20  
21   OBJREC  *objblock[MAXOBJBLK];           /* our objects */
22 < int  nobjects = 0;                      /* # of objects */
22 > OBJECT  nobjects = 0;                   /* # of objects */
23  
24  
25   readobj(input)                  /* read in an object file or stream */
26   char  *input;
27   {
28          FILE  *popen();
29 <        char  *fgets();
29 >        char  *fgets(), *fgetline();
30          FILE  *infp;
31          char  buf[512];
32          register int  c;
# Line 48 | Line 48 | char  *input;
48                          continue;
49                  if (c == '#') {                         /* comment */
50                          fgets(buf, sizeof(buf), infp);
51 <                } else if (c == '!') {                  /* pipe */
51 >                } else if (c == '!') {                  /* command */
52                          ungetc(c, infp);
53 <                        fgets(buf, sizeof(buf), infp);
54 <                        c = strlen(buf);
55 <                        if (buf[c-1] == '\n')
56 <                                buf[c-1] = '\0';
53 >                        fgetline(buf, sizeof(buf), infp);
54                          readobj(buf);
55                  } else {                                /* object */
56                          ungetc(c, infp);
# Line 108 | Line 105 | FILE  *fp;
105                          error(USER, errmsg);
106                  }
107                  objp->otype = objptr(alias)->otype;
108 <                bcopy(&objptr(alias)->oargs, &objp->oargs, sizeof(FUNARGS));
108 >                copystruct(&objp->oargs, &objptr(alias)->oargs);
109          } else if (readfargs(&objp->oargs, fp) < 0) {
110                  sprintf(errmsg, "(%s): bad arguments", name);
111                  objerror(objp, USER, errmsg);
# Line 146 | Line 143 | FILE  *fp;
143                  return(-1);
144   #ifdef  IARGS
145          if (fa->niargs = n) {
146 <                fa->iarg = (long *)bmalloc(n*sizeof(int));
146 >                fa->iarg = (long *)bmalloc(n*sizeof(long));
147                  if (fa->iarg == NULL)
148                          goto memerr;
149                  for (i = 0; i < n; i++)
# Line 185 | Line 182 | newobject()                            /* get a new object */
182                  i = nobjects >> 6;
183                  if (i >= MAXOBJBLK)
184                          return(OVOID);
185 <                objblock[i] = (OBJREC *)malloc(0100*sizeof(OBJREC));
185 >                objblock[i] = (OBJREC *)bmalloc(0100*sizeof(OBJREC));
186                  if (objblock[i] == NULL)
187                          return(OVOID);
188          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines