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

Comparing ray/src/common/caldefn.c (file contents):
Revision 1.18 by greg, Wed Aug 14 08:27:56 1991 UTC vs.
Revision 2.2 by greg, Fri May 15 16:38:49 1992 UTC

# Line 38 | Line 38 | static char SCCSid[] = "$SunId$ LBL";
38  
39   extern char  *ecalloc(), *savestr(), *strcpy();
40  
41 + static int  hash();
42 +
43   static double  dvalue();
44  
45   long  eclock = -1;                      /* value storage timer */
# Line 258 | Line 260 | incontext(qn)                  /* is qualified name in current contex
260   register char  *qn;
261   {
262      while (*qn && *qn != CNTXMARK)      /* find context mark */
263 <        ;
263 >        qn++;
264      return(!strcmp(qn, context));
265   }
266  
# Line 333 | Line 335 | varinsert(name)                        /* get a link to a variable */
335   char  *name;
336   {
337      register VARDEF  *vp;
338 <    LIBR  *libp;
338 >    register LIBR  *libp;
339      int  hv;
340      
341      if ((vp = varlookup(name)) != NULL) {
# Line 359 | Line 361 | char  *name;
361   }
362  
363  
364 + #ifdef  FUNCTION
365 + libupdate(fn)                   /* update library links */
366 + char  *fn;
367 + {
368 +    register int  i;
369 +    register VARDEF  *vp;
370 +                                        /* if fn is NULL then relink all */
371 +    for (i = 0; i < NHASH; i++)
372 +        for (vp = hashtbl[i]; vp != NULL; vp = vp->next)
373 +            if (vp->lib != NULL || fn == NULL || !strcmp(fn, vp->name))
374 +                vp->lib = liblookup(vp->name);
375 + }
376 + #endif
377 +
378 +
379   varfree(ln)                             /* release link to variable */
380   register VARDEF  *ln;
381   {
# Line 398 | Line 415 | EPNODE *
415   dnext()                         /* return pointer to next definition */
416   {
417      register EPNODE  *ep;
418 +    register char  *nm;
419  
420      while (htndx < NHASH) {
421          if (htpos == NULL)
422                  htpos = hashtbl[htndx++];
423          while (htpos != NULL) {
424              ep = htpos->def;
425 +            nm = htpos->name;
426              htpos = htpos->next;
427 <            if (ep != NULL)
427 >            if (ep != NULL && incontext(nm))
428                  return(ep);
429          }
430      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines