Back to index

radiance  4R0+20100331
Defines | Functions
setscan.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define ANGLE   short
#define AEND   (-1)

Functions

int setscan (register ANGLE *ang, register char *arg)

Define Documentation

#define AEND   (-1)

Definition at line 13 of file setscan.h.

#define ANGLE   short

Definition at line 12 of file setscan.h.


Function Documentation

int setscan ( register ANGLE ang,
register char *  arg 
)

Definition at line 14 of file setscan.c.

{
       int  state = ',';
       int  start, finish, step;

       while (state) {
              switch (state) {
              case ',':
                     start = atoi(arg);
                     finish = start;
                     step = 1;
                     break;
              case '-':
                     finish = atoi(arg);
                     if (finish < start)
                            return(-1);
                     break;
              case ':':
                     step = atoi(arg);
                     break;
              default:
                     return(-1);
              }
              if (!isdigit(*arg))
                     return(-1);
              do
                     arg++;
              while (isdigit(*arg));
              state = *arg++;
              if (!state || state == ',')
                     while (start <= finish) {
                            *ang++ = start;
                            start += step;
                     }
       }
       *ang = AEND;
       return(0);
}

Here is the call graph for this function:

Here is the caller graph for this function: