Back to index

radiance  4R0+20100331
Functions | Variables
setscan.c File Reference
#include <stdlib.h>
#include <ctype.h>
#include "setscan.h"

Go to the source code of this file.

Functions

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

Variables

static const char RCSid [] = "$Id: setscan.c,v 2.4 2004/03/26 23:34:23 schorsch Exp $"

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:


Variable Documentation

const char RCSid[] = "$Id: setscan.c,v 2.4 2004/03/26 23:34:23 schorsch Exp $" [static]

Definition at line 2 of file setscan.c.