|
|
1.1 ! root 1: #ifndef SYMTAB_H ! 2: #define SYMTAB_H ! 3: #ifndef UNIV_H ! 4: #include "univ.h" ! 5: #endif ! 6: ! 7: #include "mip.h" ! 8: extern int FunctionGathered, UTypeGathered, FunctionStubs, UTypeStubs; ! 9: extern int IdToSymCalls, StrCmpCalls; ! 10: ! 11: class SSet { ! 12: friend SymTab; friend LookupCache; ! 13: char v[8]; ! 14: public: ! 15: SSet(char=0); ! 16: SSet(char,char,char=0,char=0,char=0,char=0,char=0); ! 17: }; ! 18: ! 19: class LookupCache { ! 20: SSet set; ! 21: Symbol *sym; ! 22: long loc; ! 23: char *id; ! 24: public: ! 25: LookupCache() {} ! 26: Symbol *match(SSet, long); ! 27: void save(SSet, long, Symbol*); ! 28: }; ! 29: ! 30: class SymTab : public PadRcv { ! 31: friend Ed8SymTab; ! 32: friend BsdSymTab; friend BsdType; ! 33: friend Core; ! 34: >pub ! 35: char pub_filler[3338]; ! 36: >pri ! 37: Pad *_pad; ! 38: int fd; ! 39: char *strings; ! 40: long strsize; ! 41: long entries; ! 42: long _magic; ! 43: long relocation; ! 44: #define HASH 101 /* prime */ ! 45: Symbol *hashtable[TOSYM+1][HASH]; ! 46: Core *_core; ! 47: char *stabpath(); ! 48: Source *_root; ! 49: Block *fakeblk(); ! 50: char *dump(); ! 51: Block *_blk; ! 52: char *_warn; ! 53: Index castix[UNDEF]; // only [STRTY] [ENUMTY] used ! 54: UType *utype; ! 55: SymTab *inherit; ! 56: Var *globregs(Block*, int); ! 57: void uncfront(Var *, char*); ! 58: void showutype(UType*); ! 59: LookupCache ! 60: loctosymcache; ! 61: > ! 62: virtual char *gethdr() { return "SymTab.gethdr"; } ! 63: virtual Source *tree() { return 0; } ! 64: PUBLIC(SymTab,U_SYMTAB) ! 65: SymTab(Core*,int,SymTab* =0,long=0); ! 66: virtual ~SymTab(); ! 67: void read(); ! 68: void enter(Symbol*); ! 69: Symbol *idtosym(SSet,char*,int=1); ! 70: Symbol *loctosym(SSet,long,int=1); ! 71: Pad *pad(); ! 72: Core *core(); ! 73: char *symaddr(long); ! 74: Source *root(); ! 75: long modtime(); ! 76: Block *blk(); ! 77: char *warn(); ! 78: Index utypecarte(short); ! 79: long magic(); ! 80: UType *utypelist(); ! 81: void banner(); ! 82: virtual Block *gatherfunc(Func*); ! 83: virtual Var *gatherutype(UType*); ! 84: void opentypes(); ! 85: }; ! 86: >pri ! 87: struct nlist; struct exec; struct mlist; ! 88: ! 89: #ifdef V9 ! 90: class Ed8SymTab : public SymTab { ! 91: exec *hdr; ! 92: nlist *base; ! 93: nlist *symoff; ! 94: DType gatherdtype(nlist *); ! 95: DType chain(int, nlist *); ! 96: void gathervar(nlist*, Var**, Block*, UDisc); ! 97: int isastring(char*); ! 98: char *gettbl(); ! 99: nlist *nlistvector(long,long); ! 100: Source *tree(); ! 101: char *gethdr(); ! 102: public: ! 103: Ed8SymTab(Core*,int,SymTab* =0); ! 104: ~Ed8SymTab(); ! 105: Block *gatherfunc(Func*); ! 106: Var *gatherutype(UType*); ! 107: }; ! 108: #else ! 109: class BsdSymTab : public SymTab { ! 110: exec *hdr; ! 111: nlist *base; ! 112: nlist *symoff; ! 113: DType gatherdtype(nlist *); ! 114: DType chain(int, nlist *); ! 115: void gathervar(nlist*, Var**, Block*, UDisc); ! 116: void gathervar(nlist*, Var**, Block*, UDisc, class BsdType *); ! 117: int isastring(char*); ! 118: char *gettbl(); ! 119: nlist *nlistvector(long,long); ! 120: Source *tree(); ! 121: char *gethdr(); ! 122: BsdTShare *bsdshare; ! 123: public: ! 124: BsdSymTab(Core*,int,SymTab* =0,long=0); ! 125: ~BsdSymTab(); ! 126: Block *gatherfunc(Func*); ! 127: Var *gatherutype(UType*); ! 128: int endtext(); ! 129: }; ! 130: #endif V9 ! 131: > ! 132: char *DiscName(UDisc); ! 133: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.