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

Comparing ray/src/common/calfunc.c (file contents):
Revision 2.3 by greg, Mon May 18 14:15:49 1992 UTC vs.
Revision 2.4 by greg, Thu May 21 10:29:32 1992 UTC

# Line 337 | Line 337 | char  *fname;
337  
338  
339   #ifndef  VARIABLE
340 + static VARDEF  *varlist = NULL;         /* our list of dummy variables */
341 +
342 +
343   VARDEF *
344   varinsert(vname)                /* dummy variable insert */
345   char  *vname;
# Line 347 | Line 350 | char  *vname;
350      vp->name = savestr(vname);
351      vp->nlinks = 1;
352      vp->def = NULL;
353 <    vp->lib = NULL;
354 <    vp->next = NULL;
353 >    vp->lib = liblookup(vname);
354 >    vp->next = varlist;
355 >    varlist = vp;
356      return(vp);
357   }
358  
# Line 356 | Line 360 | char  *vname;
360   varfree(vp)                     /* free dummy variable */
361   register VARDEF  *vp;
362   {
363 +    register VARDEF  *vp2;
364 +
365 +    if (vp == varlist)
366 +        varlist = vp->next;
367 +    else {
368 +        for (vp2 = varlist; vp2->next != vp; vp2 = vp2->next)
369 +                ;
370 +        vp2->next = vp->next;
371 +    }
372      freestr(vp->name);
373      efree((char *)vp);
374 + }
375 +
376 +
377 + libupdate(nm)                   /* update library */
378 + char  *nm;
379 + {
380 +    register VARDEF  *vp;
381 +
382 +    for (vp = varlist; vp != NULL; vp = vp->next)
383 +        vp->lib = liblookup(vp->name);
384   }
385   #endif
386  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines