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.

114 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1997-2000 Microsoft Corporation
  3. Module Name:
  4. tpl.h
  5. Abstract:
  6. template file interpreter declarations
  7. Author:
  8. Gor Nishanov (gorn) 03-Apr-1999
  9. Revision History:
  10. gorn 03-Apr-1999 -- hacked it all together to prove that this can work
  11. To Do:
  12. Clean it up
  13. --*/
  14. #define INSERT_FIELD_NAMES \
  15. FIELD_NAME(__default__) \
  16. FIELD_NAME(Version) \
  17. FIELD_NAME(Time) \
  18. FIELD_NAME(Date) \
  19. FIELD_NAME(Count) \
  20. FIELD_NAME(Struct) \
  21. FIELD_NAME(Indent) \
  22. FIELD_NAME(Comment) \
  23. FIELD_NAME(Checksum) \
  24. FIELD_NAME(Messages) \
  25. FIELD_NAME(Text) \
  26. FIELD_NAME(RawText) \
  27. FIELD_NAME(MsgNames) \
  28. FIELD_NAME(MacroArgs) \
  29. FIELD_NAME(MacroExprs) \
  30. FIELD_NAME(FixedArgs) \
  31. FIELD_NAME(ReorderSig) \
  32. FIELD_NAME(Value) \
  33. FIELD_NAME(GooActualValues) \
  34. FIELD_NAME(GooArgs) \
  35. FIELD_NAME(GooVals) \
  36. FIELD_NAME(GooId) \
  37. FIELD_NAME(GooPairs) \
  38. FIELD_NAME(MsgNo) \
  39. FIELD_NAME(GuidNo) \
  40. FIELD_NAME(Guid) \
  41. FIELD_NAME(BitNo) \
  42. FIELD_NAME(Arguments) \
  43. FIELD_NAME(Permutation) \
  44. FIELD_NAME(LogArgs) \
  45. FIELD_NAME(Name) \
  46. FIELD_NAME(RawName) \
  47. FIELD_NAME(Alias) \
  48. FIELD_NAME(CtlMsg) \
  49. FIELD_NAME(Enabled) \
  50. FIELD_NAME(ID) \
  51. FIELD_NAME(GRP) \
  52. FIELD_NAME(ARG) \
  53. FIELD_NAME(MSG) \
  54. FIELD_NAME(MofType) \
  55. FIELD_NAME(DeclVars) \
  56. FIELD_NAME(References) \
  57. FIELD_NAME(No) \
  58. FIELD_NAME(Line) \
  59. FIELD_NAME(CanonicalName) \
  60. FIELD_NAME(UppercaseName) \
  61. FIELD_NAME(Timestamp) \
  62. FIELD_NAME(EquivType) \
  63. FIELD_NAME(MacroStart) \
  64. FIELD_NAME(MacroEnd) \
  65. FIELD_NAME(MacroName) \
  66. FIELD_NAME(Path) \
  67. FIELD_NAME(Extension) \
  68. FIELD_NAME(TypeSig) \
  69. FIELD_NAME(MsgVal) \
  70. FIELD_NAME(Func) \
  71. FIELD_NAME(FormatSpec)
  72. extern LPCSTR FieldNames[];
  73. enum FieldId {
  74. #define FIELD_NAME(_name_) fid_ ## _name_,
  75. INSERT_FIELD_NAMES
  76. #undef FIELD_NAME
  77. };
  78. DWORD
  79. processTemplate(
  80. IN LPCSTR begin,
  81. IN LPCSTR end,
  82. IN EZPARSE_CALLBACK Callback,
  83. IN PVOID Context,
  84. IN PEZPARSE_CONTEXT ParseContext
  85. );
  86. void PopulateFieldMap();
  87. void ProcessTemplate(LPCSTR b, LPCSTR e, void* Context);
  88. struct strless {
  89. bool operator() (const std::string& a, const std::string&b) const { return a.compare(b) < 0; }
  90. };
  91. typedef std::map<std::string, FieldHolder*, strless> OBJECT_MAP;
  92. extern OBJECT_MAP ObjectMap;