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

Comparing ray/src/common/header.c (file contents):
Revision 2.4 by greg, Sun Feb 27 10:16:45 1994 UTC vs.
Revision 2.5 by greg, Sun Oct 15 14:07:58 1995 UTC

# Line 17 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17   *  formatval(r,s)      copy the format value in s to r
18   *  fputformat(s,fp)    write "FORMAT=%s" to fp
19   *  getheader(fp,f,p)   read header from fp, calling f(s,p) on each line
20 + *  copymatch(pat, str) copy str into pat if glob match
21   *  checkheader(i,p,o)  check header format from i against p and copy to o
22   *
23   *  To copy header from input to output, use getheader(fin, fputs, fout)
# Line 48 | Line 49 | register FILE  *fp;
49   }
50  
51  
52 + int
53   headidval(r,s)                  /* get header id (return true if is id) */
54   register char  *r, *s;
55   {
# Line 61 | Line 63 | register char  *r, *s;
63   }
64  
65  
66 + int
67   isheadid(s)                     /* check to see if line is header id */
68   char  *s;
69   {
# Line 92 | Line 95 | register FILE  *fp;
95   }
96  
97  
98 + int
99   formatval(r, s)                 /* get format value (return true if format) */
100   register char  *r;
101   register char  *s;
# Line 102 | Line 106 | register char  *s;
106          while (isspace(*s)) s++;
107          if (!*s) return(0);
108          if (r == NULL) return(1);
109 <        while(*s) *r++ = *s++;
110 <        while (isspace(r[-1])) r--;
109 >        do
110 >                *r++ = *s++;
111 >        while(*s && !isspace(*s));
112          *r = '\0';
113          return(1);
114   }
115  
116  
117 + int
118   isformat(s)                     /* is line a format line? */
119   char  *s;
120   {
# Line 126 | Line 132 | FILE  *fp;
132   }
133  
134  
135 + int
136   getheader(fp, f, p)             /* get header from file */
137   FILE  *fp;
138   int  (*f)();
# Line 174 | Line 181 | register struct check  *cp;
181   * copies str into pat if there is a match (returning true).
182   */
183  
184 < #ifdef COPYMATCH
184 > int
185   copymatch(pat, str)
186   char    *pat, *str;
187   {
# Line 212 | Line 219 | char   *pat, *str;
219                  strcpy(pat, str);
220          return(1);
221   }
215 #else
216 #define copymatch(pat, s)       (!strcmp(pat, s))
217 #endif
222  
223  
224   /*
# Line 230 | Line 234 | char   *pat, *str;
234   * if fout is not NULL.
235   */
236  
237 + int
238   checkheader(fin, fmt, fout)
239   FILE  *fin;
240   char  *fmt;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines