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.

143 lines
5.1 KiB

  1. /*****************************************************************************
  2. emrulini.h
  3. Owner: DaleG
  4. Copyright (c) 1992-1997 Microsoft Corporation
  5. General Rule-Network Propagation Engine initialization types.
  6. *****************************************************************************/
  7. #ifndef EMRULINI_H
  8. #define EMRULINI_H
  9. MSOEXTERN_C_BEGIN // ***************** Begin extern "C" ********************
  10. /*************************************************************************
  11. Types:
  12. rullims Rule limits/sizes structure.
  13. ruldef Rule node initial definition structure.
  14. rulinit Rule initialization structure.
  15. *************************************************************************/
  16. /* R U L L I M S */
  17. /*----------------------------------------------------------------------------
  18. %%Structure: RULLIMS
  19. %%Contact: daleg
  20. Rule base limits structure.
  21. ----------------------------------------------------------------------------*/
  22. typedef struct _RULLIMS
  23. {
  24. short irulRulesMax; // Number of nodes
  25. short irulVarsMax; // Number of var nds
  26. short rulevtMax; // Num of event_types
  27. short rulevlMax; // Num of eval levels
  28. short rulgGroupMax; // Num dependency grps
  29. short rulgRegularMax; // Num non-context grps
  30. short clprulDependMax; // Num forward depends
  31. short clprulBackDependMax; // Num backwrd depends
  32. short ckwdMax; // Number of KWD recs
  33. short cchKwdTextMax; // Len kwd text buffer
  34. unsigned short cchNamesMax; // Name/string buf len
  35. } RULLIMS;
  36. /* R U L D E F */
  37. /*----------------------------------------------------------------------------
  38. %%Structure: RULDEF
  39. %%Contact: daleg
  40. Rule base node initialization structure.
  41. ----------------------------------------------------------------------------*/
  42. typedef struct _RULDEF
  43. {
  44. short rulevl; // Event_type/Level
  45. short bwDepend; // Fwd depend offset
  46. short bwBackDepend; // Bkwd depend offset
  47. const XCHAR *xstzKeywordName; // Keyword string
  48. } RULDEF;
  49. /* L P F N R U L C X T */
  50. /*----------------------------------------------------------------------------
  51. %%Structure: LPFNRULCXT
  52. %%Contact: daleg
  53. Rule base Context group callback function
  54. ----------------------------------------------------------------------------*/
  55. typedef void (* LPFNRULCXT) (int irul, struct _RULCXT *lprulcxt);
  56. /* R U L I N I T */
  57. /*----------------------------------------------------------------------------
  58. %%Structure: RULINIT
  59. %%Contact: daleg
  60. Rule base global initialization structure.
  61. ----------------------------------------------------------------------------*/
  62. typedef int (WIN_CALLBACK *PFNEVAL)(short irul); // Rule Eval function
  63. typedef struct _RULINIT
  64. {
  65. const RULLIMS *lprullims; // Rulebase limits
  66. const RULDEF *lprulinit; // Rulebase def
  67. const short *rgrulevlRulevt; // Event_type eval lvls
  68. const short *rgirultkRulevtHistoryMax; // Evt history depths
  69. const short *lprulgAppendTo; // Group linkages
  70. const short *lprulgAppendedFrom; // Group linkages
  71. const LPFNRULCXT *lplpfnrulcxt; // Context grp callbks
  72. const short* const *lplpirulDependents; // Dependent lists
  73. const short* const *lplpirulBackDependsOn; // DependsOn lists
  74. PFNEVAL lpfnEvalRule; // Evaluate rule code
  75. MSOKWTB **rgpkwtbKeyTables; // Keyword tables
  76. const char * const *lpszRulNames; // Node names
  77. } RULINIT;
  78. typedef int (WIN_CALLBACK *LPFNRulinit)(struct _RULS *lpruls);
  79. // Initialize pre-constructed rulebase of static nodes
  80. MSOAPI_(int) MsoFInitStaticRuls(
  81. struct _RULS *pruls,
  82. struct _RULS *prulsInit
  83. );
  84. // Create and initialize rulebase of static nodes from compressed rulebase
  85. MSOAPI_(int) MsoFInitCompressedRulebase(
  86. struct _RULS *lpruls,
  87. const RULINIT *lprulinit
  88. );
  89. #ifndef pNil
  90. #define pNil NULL
  91. #endif /* !pNil */
  92. #define IN_DATASEG
  93. #define NOT_IN_DATASEG
  94. // Rule node type flags: shared with rule.h
  95. #define rultRule 0x00 // Rule
  96. #define rultEvent 0x01 // Event/Variable
  97. #define rultPrimaryRule 0x02 // Rule auto-scheduled
  98. #define rultActionRule 0x00 // Not really a flag
  99. ///#define rultNonTermRule 0x08
  100. ///#define rultSeqRule 0x10
  101. MSOEXTERN_C_END // ****************** End extern "C" *********************
  102. #endif /* EMRULINI_H */