symtab.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Symbol table prototypes
  3. * (C) Mike van Emmerik
  4. */
  5. #pragma once
  6. /* * * * * * * * * * * * * * * * * */
  7. /* Symbol table structs and protos */
  8. /* * * * * * * * * * * * * * * * * */
  9. struct Function;
  10. struct SYMTABLE
  11. {
  12. std::string pSymName; /* Ptr to symbolic name or comment */
  13. dword symOff; /* Symbol image offset */
  14. Function *symProc; /* Procedure pointer */
  15. SYMTABLE() : symOff(0),symProc(0) {}
  16. SYMTABLE(dword _sym,Function *_proc) : symOff(_sym),symProc(_proc)
  17. {}
  18. bool operator == (const SYMTABLE &other) const
  19. {
  20. // does not yse pSymName, to ease finding by symOff/symProc combo
  21. // in map<SYMTABLE,X>
  22. return (symOff==other.symOff) && symProc==(other.symProc);
  23. }
  24. };
  25. enum tableType /* The table types */
  26. {
  27. Label=0, /* The label table */
  28. Comment, /* The comment table */
  29. NUM_TABLE_TYPES /* Number of entries: must be last */
  30. };
  31. void createSymTables(void);
  32. void destroySymTables(void);
  33. boolT readVal (std::ostringstream &symName, dword symOff, Function *symProc);
  34. void selectTable(tableType); /* Select a particular table */