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.

165 lines
7.0 KiB

  1. /*****************************************************************************
  2. emocii.h
  3. Owner: DaleG
  4. Copyright (c) 1996-1997 Microsoft Corporation
  5. OpCode Interpreter Instruction definition file
  6. *****************************************************************************/
  7. #ifndef EMOCII_H
  8. #define EMOCII_H
  9. MSOEXTERN_C_BEGIN // ***************** Begin extern "C" ********************
  10. // Define "Push Immediate" operations
  11. #define ociiImmLong (-1) // Push literal long
  12. #define ociiImmULong (-2) // Push literal ulong
  13. #define ociiImmShort (-3) // Push literal short
  14. #define ociiImmUShort (-4) // Push literal ushort
  15. #define ociiImmChar (-5) // Push literal char
  16. #define ociiImmUChar (-6) // Push literal uchar
  17. #define ociiImmFloat (-7) // Push literal float
  18. #define ociiStackValue (-8) // Push val from stack
  19. #define ociiStackAddr (-9) // Push addr from stack
  20. #define ociiGlobalValue (-10) // Push global value
  21. #define ociiGlobalAddr (-11) // Push addr of global
  22. #define ociiEventValue (-12) // Push event value
  23. #define ociiEventAddr (-13) // Push event address
  24. #define ociiImmSz (-14) // Push ptr to string
  25. #define ociiImmRg (-15) // Push ptr to array
  26. #define ociiRulFirst 55 // 1st emruloci.h fn
  27. // Define builtin functions
  28. #define ociiDelayGoToDirul 55 // DelayGoToDirul()
  29. #define ociiSignal 56 // Signal a node
  30. #define ociiSignalFrom 57 // Signal node from 2nd
  31. #define ociiRulParams 58 // Set rulebase params
  32. #define ociiDefEvent 59 // Define an event
  33. #define ociiDefRule 60 // Define a rule
  34. #define ociiMapEvalLevels 61 // Map levels for oci
  35. #define ociiUserFirst 62 // 1st User-defined fn
  36. // Define function argument "counts" that are not fixed
  37. #define ocadNonEval (-3) // Non-evaluating fn
  38. #define ocadVarArgs (-4) // Var-args function
  39. /* M S O O C I I */
  40. /*----------------------------------------------------------------------------
  41. %%Type: MSOOCII
  42. %%Contact: daleg
  43. Interpreter instruction definition.
  44. ----------------------------------------------------------------------------*/
  45. typedef short MSOOCII; // Interp instr
  46. #define MSOOCV long // Interp ret value
  47. //typedef long MSOOCV; // Interp ret value
  48. typedef signed char MSOOCAD; // Arg descriptor
  49. // Return whether the instruction pointer refers to a variable
  50. #define FVarLpocii(pocii) \
  51. (*pocii == ociiEventValue)
  52. // Define data types: these must have same order as access functions below
  53. typedef enum
  54. {
  55. ocdtChar = 0, // 0
  56. ocdtUChar, // 1
  57. ocdtShort, // 2
  58. ocdtUShort, // 3
  59. ocdtInt, // 4
  60. ocdtUInt, // 5
  61. ocdtLong, // 6
  62. ocdtULong, // 7
  63. ocdtFloat, // 8
  64. ocdtDouble, // 9
  65. ocdtLDouble, // 10
  66. ocdtPointer, // 11
  67. ocdtVoid, // 12
  68. ocdtVarArg // 13 (Take anything)
  69. } OCDT;
  70. /*----------------------------------------------------------------------------
  71. Interpreter op-code value for functions.
  72. This must be maintained in the order that the functions will appear
  73. in the op-code v-table.
  74. ----------------------------------------------------------------------------*/
  75. typedef enum
  76. {
  77. ipfnOcv_log_and = 0, // 0
  78. ipfnOcv_log_or, // 1
  79. ipfnOcv_log_not, // 2
  80. ipfnOcv_less_than, // 3
  81. ipfnOcv_less_eql, // 4
  82. ipfnOcv_eql, // 5
  83. ipfnOcv_gtr_eql, // 6
  84. ipfnOcv_gtr_than, // 7
  85. ipfnOcv_not_eql, // 8
  86. ipfnOcv_assign, // 9
  87. ipfnOcv_plus, // 10
  88. ipfnOcv_minus, // 11
  89. ipfnOcv_mult, // 12
  90. ipfnOcv_divide, // 13
  91. ipfnOcv_mod, // 14
  92. ipfnOcv_increment, // 15
  93. ipfnOcv_decrement, // 16
  94. ipfnOcv_unary_plus, // 17
  95. ipfnOcv_unary_minus, // 18
  96. ipfnOcv_bitwise_not, // 19
  97. ipfnOcv_bitwise_and, // 20
  98. ipfnOcv_bitwise_or, // 21
  99. ipfnOcv_bitwise_xor, // 22
  100. ipfnOcv_shift_l, // 23
  101. ipfnOcv_shift_r, // 24
  102. ipfnOcv_dereference, // 25
  103. ipfnOcv_addr_of, // 26
  104. ipfnOcv_cast_as, // 27
  105. ipfnOcv_if, // 28
  106. ipfnOcv_inline_if, // 29
  107. ipfnOcv_let, // 30
  108. ipfnOcv_progn, // 31
  109. ipfnOcv_compound_stmt, // 32
  110. ipfnOcv_get_char, // 33
  111. ipfnOcv_get_uchar, // 34
  112. ipfnOcv_get_short, // 35
  113. ipfnOcv_get_ushort, // 36
  114. ipfnOcv_get_int, // 37
  115. ipfnOcv_get_uint, // 38
  116. ipfnOcv_get_long, // 39
  117. ipfnOcv_get_ulong, // 40
  118. ipfnOcv_get_float, // 41
  119. ipfnOcv_get_double, // 42
  120. ipfnOcv_get_ldouble, // 43
  121. ipfnOcv_set_char, // 44
  122. ipfnOcv_set_uchar, // 45
  123. ipfnOcv_set_short, // 46
  124. ipfnOcv_set_ushort, // 47
  125. ipfnOcv_set_int, // 48
  126. ipfnOcv_set_uint, // 49
  127. ipfnOcv_set_long, // 50
  128. ipfnOcv_set_ulong, // 51
  129. ipfnOcv_set_float, // 52
  130. ipfnOcv_set_double, // 53
  131. ipfnOcv_set_ldouble, // 54
  132. } OCIT;
  133. #define ipfnOcvGetTypeFirst ipfnOcv_get_char
  134. #define ipfnOcvSetTypeFirst ipfnOcv_set_char
  135. MSOEXTERN_C_END // ****************** End extern "C" *********************
  136. #endif /* !EMOCII_H */