Back to index

wims  3.65+svn20090927
Defines | Functions | Variables
mathexp.c File Reference
#include "mathexp.h"
#include "../../Lib/libwims.h"
#include "tables.c"
#include "errors.c"
#include "lines.c"
#include "basic.c"
#include "extract.c"
#include "type.c"
#include "not.c"

Go to the source code of this file.

Defines

#define reqcnt   (sizeof(req)/sizeof(req[0]))

Functions

void parm ()
int main ()

Variables

char parmbuf [MAX_LINELEN+1]
char * objline [MAX_OBJLINES]
int objlinecnt
int thisobjline
int thislinelen
int expl1
int expl2
char * reqtype
int logdir
int linelogdir
char * fnd_position
char * fnd_nextpos
struct {
char * srcreg
regex_t cmpreg
int isvar
regexchk [MAX_REGEX]
int regexcnt = 0
struct {
char * name
void(* routine )(void)
req []
int request

Define Documentation

#define reqcnt   (sizeof(req)/sizeof(req[0]))

Definition at line 58 of file mathexp.c.


Function Documentation

int main ( void  )

Definition at line 85 of file mathexp.c.

{
    char *p;
    int i;
    
    error1=error; error2=error; error3=error;
    p=getenv("wims_exec_parm");
    if(p==NULL || *p==0) error("No input data.");
    snprintf(parmbuf,sizeof(parmbuf),"%s",p);
    parm();
    req[request].routine();
    for(i=0;i<regexcnt;i++) if(regexchk[i].isvar==0) free(&(regexchk[i].cmpreg));
    return 0;
}

Here is the call graph for this function:

void parm ( void  )

Definition at line 60 of file mathexp.c.

{
    char *p, *pp;
    for(pp=parmbuf;*pp;pp++) if(*pp=='    ') *pp='\n';
    for(objlinecnt=0,p=parmbuf; *p && objlinecnt<MAX_OBJLINES; p=pp) {
       pp=strchr(p,'\n'); if(pp) *pp++=0; else pp=p+strlen(p);
       strip_trailing_spaces(p);
       objline[objlinecnt]=p; objlinecnt++;
    }
    if(objlinecnt<1) error("Empty input data.");
    logdir=0;
    if((p=wordchr(objline[0],"<"))!=NULL) {
       logdir=-1; strcpy(p,p+1);
    }
    if((p=wordchr(objline[0],">"))!=NULL) {
       logdir=1; strcpy(p,p+1);
    }
    p=find_word_start(objline[0]); pp=find_word_end(p); if(*pp) *pp++=0;
    objline[0]=pp;
    for(request=0;request<reqcnt && strcasecmp(req[request].name,p)!=0; request++);
    if(request>=reqcnt) error("Bad request.");
    p=find_word_start(pp); pp=find_word_end(p); if(*pp) *pp++=0;
    objline[0]=pp; reqtype=p;
}

Here is the call graph for this function:


Variable Documentation

int expl1

Definition at line 26 of file mathexp.c.

int expl2

Definition at line 26 of file mathexp.c.

char* fnd_nextpos

Definition at line 30 of file mathexp.c.

char* fnd_position

Definition at line 29 of file mathexp.c.

Definition at line 28 of file mathexp.c.

int logdir

Definition at line 28 of file mathexp.c.

Definition at line 24 of file mathexp.c.

Definition at line 25 of file mathexp.c.

Definition at line 23 of file mathexp.c.

struct { ... } regexchk[MAX_REGEX]
int regexcnt = 0

Definition at line 37 of file mathexp.c.

struct { ... } req[]
char* reqtype

Definition at line 27 of file mathexp.c.

int request

Definition at line 57 of file mathexp.c.

Definition at line 25 of file mathexp.c.

Definition at line 25 of file mathexp.c.