Source code of Windows XP (NT5)
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.

110 lines
2.2 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(MsgNames) \
  27. FIELD_NAME(MacroArgs) \
  28. FIELD_NAME(MacroExprs) \
  29. FIELD_NAME(FixedArgs) \
  30. FIELD_NAME(ReorderSig) \
  31. FIELD_NAME(Value) \
  32. FIELD_NAME(GooArgs) \
  33. FIELD_NAME(GooVals) \
  34. FIELD_NAME(GooId) \
  35. FIELD_NAME(GooPairs) \
  36. FIELD_NAME(MsgNo) \
  37. FIELD_NAME(GuidNo) \
  38. FIELD_NAME(Guid) \
  39. FIELD_NAME(BitNo) \
  40. FIELD_NAME(Arguments) \
  41. FIELD_NAME(Permutation) \
  42. FIELD_NAME(LogArgs) \
  43. FIELD_NAME(Name) \
  44. FIELD_NAME(Alias) \
  45. FIELD_NAME(CtlMsg) \
  46. FIELD_NAME(Enabled) \
  47. FIELD_NAME(ID) \
  48. FIELD_NAME(GRP) \
  49. FIELD_NAME(ARG) \
  50. FIELD_NAME(MSG) \
  51. FIELD_NAME(MofType) \
  52. FIELD_NAME(DeclVars) \
  53. FIELD_NAME(References) \
  54. FIELD_NAME(No) \
  55. FIELD_NAME(Line) \
  56. FIELD_NAME(CanonicalName) \
  57. FIELD_NAME(UppercaseName) \
  58. FIELD_NAME(Timestamp) \
  59. FIELD_NAME(EquivType) \
  60. FIELD_NAME(MacroStart) \
  61. FIELD_NAME(MacroEnd) \
  62. FIELD_NAME(MacroName) \
  63. FIELD_NAME(Path) \
  64. FIELD_NAME(Extension) \
  65. FIELD_NAME(TypeSig) \
  66. FIELD_NAME(MsgVal) \
  67. FIELD_NAME(FormatSpec)
  68. extern LPCSTR FieldNames[];
  69. enum FieldId {
  70. #define FIELD_NAME(_name_) fid_ ## _name_,
  71. INSERT_FIELD_NAMES
  72. #undef FIELD_NAME
  73. };
  74. DWORD
  75. processTemplate(
  76. IN LPCSTR begin,
  77. IN LPCSTR end,
  78. IN EZPARSE_CALLBACK Callback,
  79. IN PVOID Context,
  80. IN PEZPARSE_CONTEXT ParseContext
  81. );
  82. void PopulateFieldMap();
  83. void ProcessTemplate(LPCSTR b, LPCSTR e, void* Context);
  84. struct strless {
  85. bool operator() (const std::string& a, const std::string&b) const { return a.compare(b) < 0; }
  86. };
  87. typedef std::map<std::string, FieldHolder*, strless> OBJECT_MAP;
  88. extern OBJECT_MAP ObjectMap;