fltp.h (895B)
1 //#pragma lib "libfltp.a$O" 2 3 4 enum{ 5 FLTStackSize = 64, 6 FLTTokenBufSize = 4096, 7 FLTWordSize = 16, 8 }; 9 10 typedef struct FLTWord FLTWord; 11 typedef struct FLTNode FLTNode; 12 typedef struct FLTP FLTP; 13 14 struct FLTWord{ 15 void *prev; 16 char str[FLTWordSize]; 17 void (*fp)(FLTP *); 18 }; 19 20 struct FLTNode{ 21 FLTNode *prev; 22 FLTNode *next; 23 FLTNode *parent; 24 long nbytes; 25 }; 26 27 struct FLTP{ 28 void (*rs[FLTStackSize])(FLTP *); 29 void (**fp)(FLTP *); 30 int st[FLTStackSize]; 31 int *sp; 32 FLTWord *wp; 33 FLTNode *np; 34 FLTNode *pnp; 35 char *bp; 36 char *tbuf; 37 long nbytes; 38 int ti; 39 }; 40 41 FLTP * initfltp(void); 42 void evalfltp(FLTP *, char *buf, long nbytes); 43 FLTNode * createfltnode(FLTNode *prev, FLTNode *parent, char *buf, long nbytes); 44 FLTWord * getfltword(char *str, long nbytes, FLTWord *wp); 45 46 void fltpmain(FLTP *); 47 void fltpgettoken(FLTP *); 48 void fltpstartlist(FLTP *); 49 void fltpendlist(FLTP *); 50 void fltpgetline(FLTP *);