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

Comparing ray/src/cv/mgflib/words.c (file contents):
Revision 1.1 by greg, Tue Jun 21 14:45:47 1994 UTC vs.
Revision 1.3 by greg, Fri Feb 28 20:11:30 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1994 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Routines for recognizing and moving about words in strings.
6   */
7  
8 + #include  <string.h>
9   #include  <ctype.h>
10  
11   #ifdef  BSD
# Line 16 | Line 14 | static char SCCSid[] = "$SunId$ LBL";
14  
15   #define  NULL           0
16  
19 extern char  *strchr();
17  
21
18   char *
19   iskip(s)                        /* skip integer in string */
20   register char  *s;
# Line 103 | Line 99 | char  *s, *ds;
99  
100          cp = fskip(s);
101          return(cp != NULL && strchr(ds, *cp) != NULL);
102 + }
103 +
104 +
105 + int
106 + isname(s)                       /* check for legal identifier name */
107 + register char  *s;
108 + {
109 +        while (*s == '_')                       /* skip leading underscores */
110 +                s++;
111 +        if (!isascii(*s) || !isalpha(*s))       /* start with a letter */
112 +                return(0);
113 +        while (isascii(*++s) && isgraph(*s))    /* all visible characters */
114 +                ;
115 +        return(*s == '\0');                     /* ending in nul */
116   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines