ellec.c File Reference

#include "eesite.h"
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include "eeprof.h"
#include "eefdef.h"
#include "defprf.c"

Include dependency graph for ellec.c:

Go to the source code of this file.

Data Structures

struct  fun
struct  lnode
struct  swarg
struct  lfun

Defines

#define EFUNMAX   400
#define KBTSIZ   (128*2)
#define CB_EXT   0400
#define CB_META   0200
#define EFUN(rtn, rtnstr, name)   0, name, rtnstr, 0,
#define EFUNHOLE   0, 0, 0, 0,
#define NIL   ((struct lnode *)0)
#define LTRUE   (&ltruenode)
#define LT_VAL   0
#define LT_STR   1
#define LT_LIST   2
#define LT_ATOM   3
#define SW_FLG   0
#define SW_VAR   1
#define SW_STR   2
#define MAXLINE   300
#define unlrch(c)   llstch = c
#define LSMAX   300

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (char **findkey,(char *cp, char ***aretp, char **tabp, int tabsiz, int elsize))
 _PROTOTYPE (int nstrcmp,(char *s1, char *s2))
 _PROTOTYPE (int do_opcod,(void))
 _PROTOTYPE (int outkbind,(int c, int fx))
 _PROTOTYPE (int mupcase,(int ch))
 _PROTOTYPE (char *qstr,(char *str))
 _PROTOTYPE (char *charep,(int c))
 _PROTOTYPE (int do_ocnf,(char *str))
 _PROTOTYPE (struct lnode *lread,(void))
 _PROTOTYPE (struct lnode *lrstr,(int flg))
 _PROTOTYPE (int islword,(int c))
 _PROTOTYPE (struct lnode *eval,(struct lnode *lp))
 _PROTOTYPE (int numcvt,(char *str, int *anum))
 _PROTOTYPE (int listcnt,(struct lnode *lp))
 _PROTOTYPE (char *funname,(int i))
 _PROTOTYPE (int findfun,(char *name))
 _PROTOTYPE (int funcnt,(int *arr))
 _PROTOTYPE (int scpy,(char *from, char *to, int cnt))
 _PROTOTYPE (char *stripsp,(char *cp))
int warn ()
int lerr ()
int fatal ()
 main (int argc, char **argv)
 doargs (int argc, char **argv)
char ** findkey (char *cp, char ***aretp, char **tabp, int tabsiz, int elsize)
 nstrcmp (char *s1, char *s2)
 ustrcmp (char *s1, char *s2)
 strueq (char *s1, char *s2)
 do_opcod ()
 do_opasc ()
 outkbind (c, fx)
 do_obprof ()
 mupcase (int ch)
 upcase (ch)
char * qstr (char *str)
char * charep (int c)
 do_ocnf (char *str)
 do_ofcod ()
 do_ofasc ()
 do_ofxcod ()
 compile_stdin ()
 lrch ()
lnodelread ()
 wspfls ()
lnodelrstr (flg)
 islword (c)
lnodekeybind ()
lnode ** keyallun ()
lnode *** menuitem ()
lnode **** efun ()
lnode ***** undefall ()
lnodeeval (struct lnode *lp)
lnodeundefall (struct lnode *lp)
lnodeefun (struct lnode *lp)
lnodekeybind (struct lnode *lp)
lnodemenuitem (struct lnode *lp)
 repchar (char *str)
lnodegetln ()
 numcvt (char *str, int *anum)
 listcnt (struct lnode *lp)
char * funname (int i)
 findfun (char *name)
 funcnt (int *arr)
 scpy (char *from, char *to, int cnt)
char * stripsp (char *cp)
 warn (char *str, a, b, c, d, e, f, g, h, i)
 lerr (char *str, a, b, c, d, e, f, g, h, i)
 fatal (char *str, a, b, c, d, e, f, g, h, i)

Variables

fun efuntab [EFUNMAX]
int efxmax = 0
int format_ver = PROF_VER
char * chrptr
int chrsiz = 128
int chrcnt = 0
char * mtaptr
int mtasiz = KBTSIZ
int mtacnt = 0
char * extptr
int extsiz = KBTSIZ
int extcnt = 0
char * mnuptr
int mnusiz = KBTSIZ
int mnucnt = 0
fun pdfuntab []
int npdfuns = sizeof(pdfuntab)/sizeof(struct fun)
lnode ltruenode
char * argfile
char * outfile
int swfilter
int swprof
int swelle
int uproflg
int swpcnf
int swfcnf
int swfxcnf
int swcmcnf
char * swcscnf
int swallc
int swfdmp
int nfiles
swarg swtab []
int oerrs
int llstch = -1
int leofflg
int lineno = 0
char linebuf [MAXLINE]
char * linecp = linebuf
lfun lfntab []


Define Documentation

#define CB_EXT   0400
 

Definition at line 98 of file ellec.c.

#define CB_META   0200
 

Definition at line 99 of file ellec.c.

#define EFUN rtn,
rtnstr,
name   )     0, name, rtnstr, 0,
 

#define EFUNHOLE   0, 0, 0, 0,
 

#define EFUNMAX   400
 

Definition at line 52 of file ellec.c.

Referenced by do_ocnf(), do_ofcod(), do_ofxcod(), efun(), funcnt(), and undefall().

#define KBTSIZ   (128*2)
 

Definition at line 53 of file ellec.c.

#define LSMAX   300
 

Definition at line 915 of file ellec.c.

Referenced by lrstr().

#define LT_ATOM   3
 

Definition at line 124 of file ellec.c.

#define LT_LIST   2
 

Definition at line 123 of file ellec.c.

Referenced by eval(), keybind(), lread(), and menuitem().

#define LT_STR   1
 

Definition at line 122 of file ellec.c.

Referenced by efun(), eval(), keybind(), lrstr(), and menuitem().

#define LT_VAL   0
 

Definition at line 121 of file ellec.c.

Referenced by efun(), keybind(), main(), and menuitem().

#define LTRUE   (&ltruenode)
 

Definition at line 119 of file ellec.c.

Referenced by keyallun(), and menuitem().

#define MAXLINE   300
 

Definition at line 839 of file ellec.c.

#define NIL   ((struct lnode *)0)
 

Definition at line 118 of file ellec.c.

Referenced by check(), codes(), compile_stdin(), deflate_fast(), deflate_slow(), do_macro(), efun(), eval(), fatal(), fill_window(), keybind(), lock_device(), longest_match(), lread(), lrstr(), main(), menuitem(), reader(), readline(), set_uart(), shell(), stored(), tell(), test01(), test03(), test04(), test09(), test10(), and test11().

#define SW_FLG   0
 

Definition at line 333 of file ellec.c.

Referenced by doargs().

#define SW_STR   2
 

Definition at line 335 of file ellec.c.

Referenced by doargs().

#define SW_VAR   1
 

Definition at line 334 of file ellec.c.

Referenced by doargs().

#define unlrch c   )     llstch = c
 

Definition at line 842 of file ellec.c.

Referenced by lread(), and lrstr().


Function Documentation

_PROTOTYPE char *  stripsp,
(char *cp
 

_PROTOTYPE int  scpy,
(char *from, char *to, int cnt
 

_PROTOTYPE int  funcnt,
(int *arr) 
 

_PROTOTYPE int  findfun,
(char *name
 

_PROTOTYPE char *  funname,
(int i
 

_PROTOTYPE int  listcnt,
(struct lnode *lp) 
 

_PROTOTYPE int  numcvt,
(char *str, int *anum) 
 

_PROTOTYPE struct lnode eval,
(struct lnode *lp) 
 

_PROTOTYPE int  islword,
(int c
 

_PROTOTYPE struct lnode lrstr,
(int flg) 
 

_PROTOTYPE struct lnode lread,
(void) 
 

_PROTOTYPE int  do_ocnf,
(char *str
 

_PROTOTYPE char *  charep,
(int c
 

_PROTOTYPE char *  qstr,
(char *str
 

_PROTOTYPE int  mupcase,
(int ch) 
 

_PROTOTYPE int  outkbind,
(int c, int fx) 
 

_PROTOTYPE int  do_opcod,
(void) 
 

_PROTOTYPE int  nstrcmp,
(char *s1, char *s2) 
 

_PROTOTYPE char **  findkey,
(char *cp, char ***aretp, char **tabp, int tabsiz, int elsize) 
 

_PROTOTYPE int  main,
(int argc, char **argv) 
 

char* charep int  c  ) 
 

Definition at line 648 of file ellec.c.

References CB_EXT, CB_META, and cp.

Referenced by do_opcod(), keybind(), and outkbind().

compile_stdin  ) 
 

Definition at line 830 of file ellec.c.

References eval(), lp, lread(), and NIL.

do_obprof  ) 
 

Definition at line 584 of file ellec.c.

References stored_profile::chrvcnt, stored_profile::chrvec, stored_profile::extvcnt, stored_profile::extvec, fwrite(), stored_profile::menuvcnt, stored_profile::menuvec, stored_profile::metavcnt, stored_profile::metavec, prof_pack, stdout, and stored_profile::version.

do_ocnf char *  str  ) 
 

Definition at line 681 of file ellec.c.

References cp, fun::ef_mod, fun::ef_name, EFUNMAX, efuntab, fatal(), funcnt(), NULL, printf, and unknown.

do_ofasc  ) 
 

Definition at line 757 of file ellec.c.

References fun::ef_idx, fun::ef_name, efuntab, printf, and warn.

do_ofcod  ) 
 

Definition at line 729 of file ellec.c.

References fun::ef_adr, fun::ef_name, EFUNMAX, efuntab, funcnt(), printf, and sprintf().

do_ofxcod  ) 
 

Definition at line 785 of file ellec.c.

References cp, fun::ef_adr, fun::ef_idx, fun::ef_name, EFUNMAX, efuntab, funcnt(), printf, and warn.

do_opasc  ) 
 

Definition at line 542 of file ellec.c.

References c, CB_EXT, CB_META, fatal(), outkbind(), and printf.

do_opcod  ) 
 

Definition at line 497 of file ellec.c.

References c, charep(), funname(), i, and printf.

doargs int  argc,
char **  argv
 

Definition at line 355 of file ellec.c.

References atoi, c, cnt, exit(), findkey(), fprintf(), i, isdigit, stderr, stop(), swarg::sw_astr, swarg::sw_avar, SW_FLG, swarg::sw_name, SW_STR, swarg::sw_type, SW_VAR, and swtab.

struct lnode* efun struct lnode lp  ) 
 

Definition at line 1026 of file ellec.c.

References c, fun::ef_adr, fun::ef_idx, fun::ef_mod, fun::ef_name, EFUNMAX, efuntab, fmod(), fname, lerr(), listcnt(), LT_STR, LT_VAL, NIL, NULL, num(), numcvt(), ustrcmp(), and win.

struct lnode* * * * efun  ) 
 

struct lnode* eval struct lnode lp  ) 
 

Definition at line 980 of file ellec.c.

References lerr(), lfun::lfname, lfun::lfrtn, lnode::lnxt, LT_LIST, LT_STR, lnode::ltyp, lnode::lval, lnode::lvl, lnode::lvs, NIL, and strueq().

Referenced by compile_stdin(), endofgame(), execute(), and macro().

fatal char *  str,
a  ,
b  ,
c  ,
d  ,
,
f  ,
g  ,
,
i 
 

Definition at line 1398 of file ellec.c.

References a, b, c, d, e, exit(), g, and warn.

int fatal  ) 
 

findfun char *  name  ) 
 

Definition at line 1326 of file ellec.c.

References efuntab, and strueq().

Referenced by keybind(), and menuitem().

char** findkey char *  cp,
char ***  aretp,
char **  tabp,
int  tabsiz,
int  elsize
 

Definition at line 424 of file ellec.c.

References i, and ustrcmp().

Referenced by doargs().

funcnt int *  arr  ) 
 

Definition at line 1343 of file ellec.c.

References EFUNMAX.

Referenced by do_ocnf(), do_ofcod(), and do_ofxcod().

char* funname int  i  ) 
 

Definition at line 1317 of file ellec.c.

References cp, efuntab, and NULL.

Referenced by do_opcod().

struct lnode* getln  ) 
 

Definition at line 1281 of file ellec.c.

References calloc().

Referenced by lread(), and lrstr().

islword c   ) 
 

Definition at line 955 of file ellec.c.

References c.

Referenced by lrstr(), and qstr().

struct lnode * keyallun  ) 
 

Definition at line 1209 of file ellec.c.

References cp, and LTRUE.

struct lnode* keybind struct lnode lp  ) 
 

Definition at line 1120 of file ellec.c.

References c, CB_EXT, charep(), findfun(), lerr(), lnode::lnxt, LT_LIST, LT_STR, LT_VAL, NIL, and repchar().

struct lnode* keybind  ) 
 

lerr char *  str,
a  ,
b  ,
c  ,
d  ,
,
f  ,
g  ,
,
i 
 

Definition at line 1390 of file ellec.c.

References a, b, c, d, e, fprintf(), g, linebuf, linecp, lineno, stderr, and warn.

int lerr  ) 
 

Referenced by efun(), eval(), and keybind().

listcnt struct lnode lp  ) 
 

Definition at line 1304 of file ellec.c.

Referenced by efun().

lrch  ) 
 

Definition at line 848 of file ellec.c.

References c, EOF, getc, and stdin.

Referenced by lread(), lrstr(), and wspfls().

struct lnode* lread  ) 
 

Definition at line 872 of file ellec.c.

References c, EOF, getln(), head, lp, lrch(), lrstr(), LT_LIST, NIL, unlrch, and wspfls().

Referenced by compile_stdin().

struct lnode* lrstr flg   ) 
 

Definition at line 917 of file ellec.c.

References c, cbuf, cp, EOF, getln(), islword(), lp, lrch(), LSMAX, LT_STR, malloc(), NIL, ok(), out, strcpy(), and unlrch.

Referenced by lread().

main int  argc,
char **  argv
 

Definition at line 200 of file ellec.c.

References charmap, cp, def_prof, doargs(), fun::ef_adr, fun::ef_name, efuntab, extmap, fatal(), i, LT_VAL, ltruenode, lnode::ltyp, malloc(), profile::menuvcnt, profile::menuvec, metamap, pdfuntab, scpy(), and stripsp().

struct lnode* menuitem struct lnode lp  ) 
 

Definition at line 1223 of file ellec.c.

References findfun(), LT_LIST, LT_STR, LT_VAL, LTRUE, and NIL.

struct lnode* * * menuitem  ) 
 

mupcase int  ch  ) 
 

Definition at line 618 of file ellec.c.

References upcase().

Referenced by repchar().

nstrcmp char *  s1,
char *  s2
 

Definition at line 454 of file ellec.c.

References c, d, and upcase().

numcvt char *  str,
int *  anum
 

Definition at line 1285 of file ellec.c.

References c, cp, isdigit, and sign.

Referenced by efun().

outkbind c  ,
fx 
 

Definition at line 564 of file ellec.c.

References c, charep(), efuntab, NULL, printf, and qstr().

Referenced by do_opasc().

char* qstr char *  str  ) 
 

Definition at line 629 of file ellec.c.

References c, cp, and islword().

Referenced by outkbind().

repchar char *  str  ) 
 

Definition at line 1249 of file ellec.c.

References c, CB_EXT, mupcase(), strlen(), and upcase().

Referenced by keybind().

scpy char *  from,
char*  to,
int  cnt
 

Definition at line 1359 of file ellec.c.

Referenced by main().

char* stripsp char *  cp  ) 
 

Definition at line 1369 of file ellec.c.

References ep, lastp, and strlen().

Referenced by main().

strueq char *  s1,
char *  s2
 

Definition at line 489 of file ellec.c.

References ustrcmp().

Referenced by eval(), and findfun().

struct lnode* undefall struct lnode lp  ) 
 

Definition at line 1007 of file ellec.c.

References fun::ef_adr, fun::ef_mod, fun::ef_name, EFUNMAX, and efuntab.

struct lnode* * * * * undefall  ) 
 

upcase ch   ) 
 

Definition at line 622 of file ellec.c.

References c.

ustrcmp char *  s1,
char *  s2
 

Definition at line 473 of file ellec.c.

References c, and upcase().

warn char *  str,
a  ,
b  ,
c  ,
d  ,
,
f  ,
g  ,
,
i 
 

Definition at line 1382 of file ellec.c.

References a, b, c, d, e, fprintf(), g, and stderr.

int warn  ) 
 

wspfls  ) 
 

Definition at line 902 of file ellec.c.

References c, EOF, isspace, and lrch().

Referenced by lread().


Variable Documentation

char* argfile
 

Definition at line 184 of file ellec.c.

int chrcnt = 0
 

Definition at line 83 of file ellec.c.

char* chrptr
 

Definition at line 81 of file ellec.c.

int chrsiz = 128
 

Definition at line 82 of file ellec.c.

struct fun efuntab[EFUNMAX]
 

Definition at line 66 of file ellec.c.

Referenced by do_ocnf(), do_ofasc(), do_ofcod(), do_ofxcod(), efun(), findfun(), funname(), main(), outkbind(), and undefall().

int efxmax = 0
 

Definition at line 67 of file ellec.c.

int extcnt = 0
 

Definition at line 91 of file ellec.c.

char* extptr
 

Definition at line 89 of file ellec.c.

int extsiz = KBTSIZ
 

Definition at line 90 of file ellec.c.

int format_ver = PROF_VER
 

Definition at line 69 of file ellec.c.

int leofflg
 

Definition at line 841 of file ellec.c.

struct lfun lfntab[]
 

char linebuf
 

Definition at line 845 of file ellec.c.

Referenced by add(), compile(), httpget(), interact(), lerr(), and readbox().

char* linecp = linebuf
 

Definition at line 846 of file ellec.c.

Referenced by lerr().

int lineno = 0
 

Definition at line 844 of file ellec.c.

int llstch = -1
 

Definition at line 840 of file ellec.c.

struct lnode ltruenode
 

Definition at line 136 of file ellec.c.

Referenced by main().

int mnucnt = 0
 

Definition at line 95 of file ellec.c.

char* mnuptr
 

Definition at line 93 of file ellec.c.

int mnusiz = KBTSIZ
 

Definition at line 94 of file ellec.c.

int mtacnt = 0
 

Definition at line 87 of file ellec.c.

char* mtaptr
 

Definition at line 85 of file ellec.c.

int mtasiz = KBTSIZ
 

Definition at line 86 of file ellec.c.

int nfiles
 

Definition at line 198 of file ellec.c.

Referenced by columnise(), listfiles(), main(), nextfile(), and processfiles().

int npdfuns = sizeof(pdfuntab)/sizeof(struct fun)
 

Definition at line 272 of file ellec.c.

int oerrs
 

Definition at line 540 of file ellec.c.

char* outfile
 

Definition at line 185 of file ellec.c.

struct fun pdfuntab[]
 

Definition at line 107 of file ellec.c.

Referenced by main().

int swallc
 

Definition at line 196 of file ellec.c.

int swcmcnf
 

Definition at line 194 of file ellec.c.

char* swcscnf
 

Definition at line 195 of file ellec.c.

int swelle
 

Definition at line 188 of file ellec.c.

int swfcnf
 

Definition at line 192 of file ellec.c.

int swfdmp
 

Definition at line 197 of file ellec.c.

int swfilter
 

Definition at line 186 of file ellec.c.

int swfxcnf
 

Definition at line 193 of file ellec.c.

int swpcnf
 

Definition at line 191 of file ellec.c.

int swprof
 

Definition at line 187 of file ellec.c.

struct swarg swtab[]
 

Referenced by doargs().

int uproflg
 

Definition at line 190 of file ellec.c.


Generated on Fri Apr 14 23:02:45 2006 for minix by  doxygen 1.4.6