Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
1.9 KiB

  1. //
  2. // Copyright (c) Microsoft Corporation 1995
  3. //
  4. // symtab.h
  5. //
  6. // Header file for the symbol table.
  7. //
  8. // History:
  9. // 04-30-95 ScottH Created
  10. //
  11. #ifndef __SYMTAB_H__
  12. #define __SYMTAB_H__
  13. //
  14. // DATATYPE
  15. //
  16. typedef enum
  17. {
  18. DATA_INT, // Uses er.nVal
  19. DATA_BOOL, // Uses er.bVal
  20. DATA_STRING, // Uses er.psz
  21. DATA_LABEL, // Uses er.dw as code address
  22. DATA_PROC,
  23. } DATATYPE;
  24. DECLARE_STANDARD_TYPES(DATATYPE);
  25. //
  26. // EVALRES (evaluation result)
  27. //
  28. typedef struct tagEVALRES
  29. {
  30. union
  31. {
  32. LPSTR psz;
  33. int nVal;
  34. BOOL bVal;
  35. ULONG_PTR dw;
  36. };
  37. } EVALRES;
  38. DECLARE_STANDARD_TYPES(EVALRES);
  39. //
  40. // Symbol Table Entry
  41. //
  42. typedef struct tagSTE
  43. {
  44. LPSTR pszIdent;
  45. DATATYPE dt;
  46. EVALRES er;
  47. } STE; // symbol table entry
  48. DECLARE_STANDARD_TYPES(STE);
  49. RES PUBLIC STE_Create(PSTE * ppste, LPCSTR pszIdent, DATATYPE dt);
  50. RES PUBLIC STE_Destroy(PSTE this);
  51. RES PUBLIC STE_GetValue(PSTE this, PEVALRES per);
  52. #define STE_GetIdent(pste) ((pste)->pszIdent)
  53. #define STE_GetDataType(pste) ((pste)->dt)
  54. //
  55. // Symbol Table
  56. //
  57. typedef struct tagSYMTAB
  58. {
  59. HPA hpaSTE; // element points to STE
  60. struct tagSYMTAB * pstNext;
  61. } SYMTAB;
  62. DECLARE_STANDARD_TYPES(SYMTAB);
  63. #define Symtab_GetNext(pst) ((pst)->pstNext)
  64. RES PUBLIC Symtab_Destroy(PSYMTAB this);
  65. RES PUBLIC Symtab_Create(PSYMTAB * ppst, PSYMTAB pstNext);
  66. // Symtab_Find flags
  67. #define STFF_DEFAULT 0x0000
  68. #define STFF_IMMEDIATEONLY 0x0001
  69. RES PUBLIC Symtab_FindEntry(PSYMTAB this, LPCSTR pszIdent, DWORD dwFlags, PSTE * ppsteOut, PSYMTAB * ppstScope);
  70. RES PUBLIC Symtab_InsertEntry(PSYMTAB this, PSTE pste);
  71. RES PUBLIC Symtab_NewLabel(PSYMTAB this, LPSTR pszIdentBuf);
  72. #endif // __SYMTAB_H__