v.c File Reference

#include <stdio.h>
#include <ctype.h>
#include "awk.h"
#include "regexp.h"

Include dependency graph for v.c:

Go to the source code of this file.

Defines

#define PI   3.14159265358979323846
#define HASHSIZE   50
#define MAXFIELD   100

Functions

double atof ()
char * getsval ()
char ** jStrchar ()
CELLexecute ()
CELL ** _Arg ()
char * strsave ()
char ** emalloc ()
char *** strchr ()
CELLlookup ()
CELL ** install ()
CELL *** _install ()
CELL **** mkcell ()
CELL ***** mktmp ()
CELL ****** getvar ()
 init ()
 setvar (char *s)
 initarg (char *arg0, argc, char **argv)
static hash (unsigned char *s)
CELLlookup (char *s, h)
static CELLinstall (char *name, type, char *sval, double fval, h)
static CELL_install (char *name, type, char *sval, double fval, h)
CELLgetvar (char *s, h, typ)
 fixarray (CELL *u)
 a_free (CELL *u)
CELLArray (NODE *p)
static arrayelm (NODE *p, char *s)
CELLElement (NODE *p)
CELLDelete (NODE *p)
CELLIn (NODE *p)
CELLSplit (NODE *p)
CELLForin (NODE *p)
char * strsave (char *s)
 sfree (char *p)
 isnum (char *s)
 setfval (CELL *u, double f)
 setsval (CELL *u, char *s)
double getfval (CELL *u)
char * getsval (CELL *u)
char * emalloc (unsigned n)
 Free (char *s)

Variables

char record []
CELLfield []
CELL truecell
CELL falsecell
 prmflg
SYMBOLhashtab [HASHSIZE]
SYMBOLfuntab [HASHSIZE]
SYMBOLargtab [HASHSIZE]
char ** FS
char ** RS
char ** OFS
char ** ORS
char ** OFMT
char ** FILENAME
char ** SUBSEP
double * NR
double * NF
double * FNR
double * ARGC
double * RSTART
double * RLENGTH


Define Documentation

#define HASHSIZE   50
 

Definition at line 23 of file v.c.

Referenced by a_free(), dodump(), fixarray(), Forin(), getvar(), hash(), In(), and inspect().

#define MAXFIELD   100
 

Definition at line 24 of file v.c.

#define PI   3.14159265358979323846
 

Definition at line 21 of file v.c.

Referenced by init().


Function Documentation

CELL* * _Arg  ) 
 

static CELL* _install char *  name,
type  ,
char *  sval,
double  fval,
[static]
 

Definition at line 142 of file v.c.

References atof(), emalloc(), hash(), isnum(), NUM, p, strsave(), and type.

CELL* * * _install  ) 
 

Referenced by getvar(), and install().

a_free CELL u  ) 
 

Definition at line 236 of file v.c.

References ARR, c_free(), error, HASHSIZE, i, r, symbol::s_name, symbol::s_next, symbol::s_val, and sfree().

Referenced by Call().

CELL* Array NODE p  ) 
 

Definition at line 259 of file v.c.

References _Arg(), ARR, arrayelm(), BUFSIZ, cell::c_fval, cell::c_sval, cell::c_type, error, fixarray(), getvar(), i, if(), int(), n, NUM, POS, STR, UDF, and VAR.

static arrayelm NODE p,
char *  s
[static]
 

Definition at line 289 of file v.c.

References c_free(), execute(), getsval(), i, int(), n, SUBSEP, and t.

Referenced by Array(), Delete(), and Element().

double atof  ) 
 

CELL* Delete NODE p  ) 
 

Definition at line 323 of file v.c.

References ARR, arrayelm(), BUFSIZ, cell::c_sval, cell::c_type, error, hash(), i, if(), NULL, r, symbol::s_next, sfree(), and strcmp.

CELL* Element NODE p  ) 
 

Definition at line 314 of file v.c.

References arrayelm(), BUFSIZ, mktmp(), and STR.

char* emalloc unsigned  n  ) 
 

Definition at line 662 of file v.c.

References error, malloc(), NULL, and p.

char* * emalloc  ) 
 

Referenced by _install(), Call(), doprint(), doreturn(), expr10(), fixarray(), getvar(), mkcell(), node0(), node1(), node2(), node3(), node4(), regcomp(), and strsave().

CELL* execute void   ) 
 

Definition at line 1577 of file boot.c.

fixarray CELL u  ) 
 

Definition at line 219 of file v.c.

References ARR, emalloc(), HASHSIZE, i, NULL, sfree(), and UDF.

Referenced by Array(), and Split().

CELL* Forin NODE p  ) 
 

Definition at line 472 of file v.c.

References ARR, c_free(), cell::c_sval, cell::c_type, error, execute(), HASHSIZE, i, NUM, symbol::s_name, symbol::s_next, setsval(), synerr(), UDF, and VAR.

Free char *  s  ) 
 

Definition at line 680 of file v.c.

References free.

double getfval CELL u  ) 
 

Definition at line 604 of file v.c.

References atof(), isnum(), NUM, STR, strsave(), UDF, VAR, and x.

char* getsval CELL u  ) 
 

Definition at line 630 of file v.c.

References fprintf(), NUM, OFMT, s, sfree(), sprintf(), stderr, STR, strsave(), UDF, and VAR.

char* getsval  ) 
 

CELL* getvar char *  s,
,
typ 
 

Definition at line 168 of file v.c.

References _install(), ARR, cell::c_fval, cell::c_sval, cell::c_type, emalloc(), hash(), HASHSIZE, i, lookup(), NULL, p, prmflg, sfree(), strsave(), t, and UDF.

CELL* * * * * * getvar  ) 
 

static hash unsigned char *  s  )  [static]
 

Definition at line 109 of file v.c.

References HASHSIZE.

Referenced by _install(), addent(), calcHash(), create_symbol_table(), Delete(), eth_arrive(), exec_one(), find_cache_ent(), getvar(), hash_fd(), initkwds(), ip_hash_proto(), ip_port_arrive(), ip_unhash_proto(), iroute_frag(), lookup(), oroute_find_ent(), remhash(), tcp_put_pkt(), udp_ip_arrived(), and unhash_fd().

CELL* In NODE p  ) 
 

Definition at line 350 of file v.c.

References ARR, c_free(), cell::c_sval, cell::c_type, error, execute(), getsval(), HASHSIZE, i, if(), NULL, s, symbol::s_name, symbol::s_next, strcmp, and truecell.

init  ) 
 

Definition at line 48 of file v.c.

References cell::c_sval, field, FILENAME, FNR, FS, hashtab, install, mkcell(), NF, NR, NULL, NUM, OFMT, OFS, ORS, PI, REC, record, RLENGTH, RS, RSTART, STR, SUBSEP, and VAR.

initarg char *  arg0,
argc  ,
char **  argv
 

Definition at line 89 of file v.c.

References argc, ARGC, argtab, ARR, atof(), cell::c_sval, hashtab, i, install, isnum(), NULL, NUM, sprintf(), STR, and VAR.

static CELL* install char *  name,
type  ,
char *  sval,
double  fval,
[static]
 

Definition at line 130 of file v.c.

References _install(), error, lookup(), NULL, and type.

CELL* * install  ) 
 

isnum char *  s  ) 
 

Definition at line 523 of file v.c.

References isdigit, NULL, strchr, and strcmp.

Referenced by _install(), getfval(), initarg(), Return(), setsval(), setvar(), and Split().

char* * jStrchar  ) 
 

CELL* lookup char *  s,
 

Definition at line 119 of file v.c.

References hash(), NULL, p, return(), and strcmp.

CELL* lookup  ) 
 

Referenced by assign(), compile(), dodefine(), dodefn(), dodump(), doread(), doshift(), eval(), execute(), forkexec(), get_name(), getvar(), imhand(), install(), ljhand(), main(), mqhand(), mtrans(), open_new_file(), processrequest(), rdexp(), setdash(), setstatus(), setvar(), sjhand(), and value().

CELL* * * * mkcell  ) 
 

CELL* * * * * mktmp  ) 
 

Referenced by Arith(), Cat(), Cond(), Element(), execute(), Getline(), Mathfun(), Return(), Strfun(), and Subst().

setfval CELL u,
double  f
 

Definition at line 552 of file v.c.

References FLD, fprintf(), mkrec(), NULL, NUM, REC, sfree(), stderr, STR, TMP, UDF, and VAR.

Referenced by Arith(), Assign(), and Split().

setsval CELL u,
char *  s
 

Definition at line 573 of file v.c.

References atof(), FLD, fprintf(), isnum(), mkrec(), NUM, REC, sfree(), stderr, STR, strsave(), TMP, UDF, and VAR.

Referenced by Assign(), Forin(), Getline(), Split(), and Subst().

setvar char *  s  ) 
 

Definition at line 67 of file v.c.

References atof(), hashtab, install, isnum(), lookup(), NULL, NUM, STR, t, and VAR.

sfree char *  p  ) 
 

Definition at line 517 of file v.c.

References Free, and NULL.

CELL* Split NODE p  ) 
 

Definition at line 377 of file v.c.

References ARR, atof(), BUFSIZ, c_free(), cell::c_sval, cell::c_type, error, execute(), fixarray(), FS, getsval(), getvar(), i, if(), int(), isnum(), match, mkpat(), n, NULL, r_length, r_start, s, sep, setfval(), setsval(), sfree(), skip, sprintf(), strcmp, strlen(), strsave(), t, UDF, and VAR.

char* * * strchr  ) 
 

char* strsave char *  s  ) 
 

Definition at line 506 of file v.c.

References emalloc(), n, NULL, strcpy(), and strlen().

char* strsave  ) 
 


Variable Documentation

double * ARGC
 

Definition at line 46 of file v.c.

Referenced by Getrec(), and initarg().

SYMBOL* argtab[HASHSIZE]
 

Definition at line 38 of file v.c.

Referenced by Getrec(), and initarg().

CELL falsecell
 

Definition at line 44 of file e.c.

Referenced by Cond().

CELL* field[]
 

Definition at line 48 of file r.c.

char ** FILENAME
 

Definition at line 43 of file v.c.

double* FNR
 

Definition at line 46 of file v.c.

Referenced by Getrec(), and init().

char** FS
 

Definition at line 43 of file v.c.

SYMBOL* funtab[HASHSIZE]
 

Definition at line 37 of file v.c.

Referenced by askerr(), dousrfun(), and expr10().

SYMBOL* hashtab[HASHSIZE]
 

Definition at line 36 of file v.c.

Referenced by addent(), dodump(), dofor(), dofuncn(), expr10(), expr4(), init(), initarg(), initkwds(), inspect(), lookup(), remhash(), and setvar().

double * NF
 

Definition at line 45 of file v.c.

double* NR
 

Definition at line 45 of file v.c.

char ** OFMT
 

Definition at line 43 of file v.c.

Referenced by getsval(), and init().

char ** OFS
 

Definition at line 43 of file v.c.

char ** ORS
 

Definition at line 43 of file v.c.

prmflg
 

Definition at line 46 of file y.c.

Referenced by dofuncn(), and getvar().

char record[]
 

Definition at line 47 of file r.c.

double * RLENGTH
 

Definition at line 46 of file v.c.

Referenced by init(), and Strfun().

char ** RS
 

Definition at line 43 of file v.c.

double * RSTART
 

Definition at line 46 of file v.c.

Referenced by init(), and Strfun().

char** SUBSEP
 

Definition at line 44 of file v.c.

Referenced by arrayelm(), and init().

CELL truecell
 

Definition at line 43 of file e.c.

Referenced by Call(), Cond(), If(), In(), Nulproc(), P1stat(), P2stat(), and Print0().


Generated on Fri Apr 14 22:59:20 2006 for minix by  doxygen 1.4.6