Back to index

radiance  4R0+20100331
Functions | Variables
words.c File Reference
#include <string.h>
#include <ctype.h>

Go to the source code of this file.

Functions

char * iskip (char *s)
char * fskip (char *s)
int isint (char *s)
int isintd (char *s, char *ds)
int isflt (char *s)
int isfltd (char *s, char *ds)
int isname (char *s)

Variables

static const char RCSid [] = "$Id: words.c,v 1.4 2003/03/11 17:08:55 greg Exp $"

Function Documentation

char* fskip ( char *  s)

Definition at line 30 of file words.c.

{
       register char  *cp;

       while (isspace(*s))
              s++;
       if (*s == '-' || *s == '+')
              s++;
       cp = s;
       while (isdigit(*cp))
              cp++;
       if (*cp == '.') {
              cp++; s++;
              while (isdigit(*cp))
                     cp++;
       }
       if (cp == s)
              return(NULL);
       if (*cp == 'e' || *cp == 'E')
              return(iskip(cp+1));
       return(cp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int isflt ( char *  s)

Definition at line 78 of file words.c.

{
       register char  *cp;

       cp = fskip(s);
       return(cp != NULL && *cp == '\0');
}

Here is the call graph for this function:

Here is the caller graph for this function:

int isfltd ( char *  s,
char *  ds 
)

Definition at line 89 of file words.c.

{
       register char  *cp;

       cp = fskip(s);
       return(cp != NULL && strchr(ds, *cp) != NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int isint ( char *  s)

Definition at line 56 of file words.c.

{
       register char  *cp;

       cp = iskip(s);
       return(cp != NULL && *cp == '\0');
}

Here is the call graph for this function:

int isintd ( char *  s,
char *  ds 
)

Definition at line 67 of file words.c.

{
       register char  *cp;

       cp = iskip(s);
       return(cp != NULL && strchr(ds, *cp) != NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* iskip ( char *  s)

Definition at line 13 of file words.c.

{
       while (isspace(*s))
              s++;
       if (*s == '-' || *s == '+')
              s++;
       if (!isdigit(*s))
              return(NULL);
       do
              s++;
       while (isdigit(*s));
       return(s);
}

Here is the caller graph for this function:

int isname ( char *  s)

Definition at line 100 of file words.c.

{
       while (*s == '_')                  /* skip leading underscores */
              s++;
       if (!isascii(*s) || !isalpha(*s))  /* start with a letter */
              return(0);
       while (isascii(*++s) && isgraph(*s))      /* all visible characters */
              ;
       return(*s == '\0');                /* ending in nul */
}

Here is the caller graph for this function:


Variable Documentation

const char RCSid[] = "$Id: words.c,v 1.4 2003/03/11 17:08:55 greg Exp $" [static]

Definition at line 2 of file words.c.