Back to index

radiance  4R0+20100331
Functions | Variables
misc.c File Reference
#include "rtio.h"
#include "meta.h"

Go to the source code of this file.

Functions

int comndx (register int c)
PRIMITIVE * pop (register PLIST *pl)
void push (register PRIMITIVE *p, register PLIST *pl)
void add (register PRIMITIVE *p, register PLIST *pl)
void append (register PLIST *pl1, register PLIST *pl2)
void fargs (register PRIMITIVE *p)
char * nextscan (register char *start, char *format, char *result)
void mcopy (register char *p1, register char *p2, register int n)

Variables

static const char RCSid [] = "$Id: misc.c,v 1.5 2005/09/23 19:22:37 greg Exp $"
char coms [] = COML

Function Documentation

void add ( register PRIMITIVE *  p,
register PLIST *  pl 
)

Definition at line 78 of file misc.c.

{

 if (pl->ptop == NULL)
    pl->ptop = p;
 else
    pl->pbot->pnext = p;
 p->pnext = NULL;
 pl->pbot = p;

 }
void append ( register PLIST *  pl1,
register PLIST *  pl2 
)

Definition at line 96 of file misc.c.

{

    if (pl1->ptop != NULL) {
        if (pl2->ptop != NULL)
            pl2->pbot->pnext = pl1->ptop;
        else
            pl2->ptop = pl1->ptop;
        pl2->pbot = pl1->pbot;
    }

}
int comndx ( register int  c)

Definition at line 20 of file misc.c.

{
 register char  *cp;

 if (!isalpha(c))
    return(-1);

 for (cp = coms; *cp; cp++)
    if(*cp == c)
       return(cp-coms);

 return(-1);
 }
void fargs ( register PRIMITIVE *  p)

Definition at line 116 of file misc.c.

{

 if (p->args != NULL) {
    freestr(p->args);
    p->args = NULL;
    }
    
 }

Here is the call graph for this function:

void mcopy ( register char *  p1,
register char *  p2,
register int  n 
)

Definition at line 153 of file misc.c.

{

    while (n--)
       *p1++ = *p2++;

}
char* nextscan ( register char *  start,
char *  format,
char *  result 
)

Definition at line 132 of file misc.c.

{

    if (start == NULL) return(NULL);
    
    while (isspace(*start)) start++;
    
    if (sscanf(start, format, result) != 1) return(NULL);
    
    while (*start && !isspace(*start)) start++;
    
    return(start);
}
PRIMITIVE* pop ( register PLIST *  pl)

Definition at line 43 of file misc.c.

{
 register PRIMITIVE  *p;

 if ((p = pl->ptop) != NULL)  {
    if ((pl->ptop = p->pnext) == NULL)
       pl->pbot = NULL;
    p->pnext = NULL;
    }

 return(p);
 }
void push ( register PRIMITIVE *  p,
register PLIST *  pl 
)

Definition at line 62 of file misc.c.

{

 if ((p->pnext = pl->ptop) == NULL)
    pl->pbot = p;
 pl->ptop = p;

 }

Variable Documentation

char coms[] = COML

Definition at line 13 of file misc.c.

const char RCSid[] = "$Id: misc.c,v 1.5 2005/09/23 19:22:37 greg Exp $" [static]

Definition at line 2 of file misc.c.