symtab.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Symbol table prototypes
  3. * (C) Mike van Emmerik
  4. */
  5. /* * * * * * * * * * * * * * * * * */
  6. /* Symbol table structs and protos */
  7. /* * * * * * * * * * * * * * * * * */
  8. typedef struct
  9. {
  10. char *pSymName; /* Ptr to symbolic name or comment */
  11. dword symOff; /* Symbol image offset */
  12. PPROC symProc; /* Procedure pointer */
  13. word preHash; /* Hash value before the modulo */
  14. word postHash; /* Hash value after the modulo */
  15. word nextOvf; /* Next entry this hash bucket, or -1 */
  16. word prevOvf; /* Back link in Ovf chain */
  17. } SYMTABLE;
  18. enum _tableType /* The table types */
  19. {
  20. Label=0, /* The label table */
  21. Comment, /* The comment table */
  22. NUM_TABLE_TYPES /* Number of entries: must be last */
  23. };
  24. typedef enum _tableType tableType; /* For convenience */
  25. void createSymTables(void);
  26. void destroySymTables(void);
  27. void enterSym(char *symName, dword symOff, PPROC symProc, boolT bSymToo);
  28. boolT readSym (char *symName, dword *pSymOff, PPROC *pSymProc);
  29. boolT readVal (char *symName, dword symOff, PPROC symProc);
  30. void deleteSym(char *symName);
  31. void deleteVal(dword symOff, PPROC symProc, boolT bSymToo);
  32. boolT findVal(dword symOff, PPROC symProc, word *pIndex);
  33. word symHash(char *name, word *pre);
  34. word valHash(dword off, PPROC proc, word *pre);
  35. void selectTable(tableType); /* Select a particular table */
  36. char *addStrTbl(char *pStr); /* Add string to string table */