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.4 by greg, Tue Mar 11 17:08:55 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  
13 #ifdef  BSD
14 #define  strchr         index
15 #endif
11  
17 #define  NULL           0
18
19 extern char  *strchr();
20
21
12   char *
13   iskip(s)                        /* skip integer in string */
14   register char  *s;
# Line 103 | Line 93 | char  *s, *ds;
93  
94          cp = fskip(s);
95          return(cp != NULL && strchr(ds, *cp) != NULL);
96 + }
97 +
98 +
99 + int
100 + isname(s)                       /* check for legal identifier name */
101 + register char  *s;
102 + {
103 +        while (*s == '_')                       /* skip leading underscores */
104 +                s++;
105 +        if (!isascii(*s) || !isalpha(*s))       /* start with a letter */
106 +                return(0);
107 +        while (isascii(*++s) && isgraph(*s))    /* all visible characters */
108 +                ;
109 +        return(*s == '\0');                     /* ending in nul */
110   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines