home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / 123rexx.zip / LEP.H next >
Text File  |  1992-09-02  |  17KB  |  282 lines

  1. #if      !defined(LEP_H)
  2. #define  LEP_H
  3. /****************************************************************************/
  4. /**   Module Name: LEP.H                                                   **/
  5. /**   123 for OS/2 External Programming include file                       **/
  6. /**   Copyright (c) 1991, Lotus Development Corporation                    **/
  7. /****************************************************************************/
  8.  
  9. /****************************************************************************/
  10. /**   Constants                                                            **/
  11. /****************************************************************************/
  12.  
  13. /****************************************************************************/
  14. /**   messages sent to the Library Manager function                        **/
  15. /****************************************************************************/
  16. #define  LEPC_MSG_BASE                    0
  17. #define  LEPC_MSG_ATTACH                  (LEPC_MSG_BASE+0)
  18. #define  LEPC_MSG_DETACH                  (LEPC_MSG_BASE+1)
  19. #define  LEPC_MSG_BREAK                   (LEPC_MSG_BASE+2)
  20.  
  21. /****************************************************************************/
  22. /**   @function registration options                                       **/
  23. /****************************************************************************/
  24. #define  LEPC_OPT_REG_NONE                0
  25. #define  LEPC_OPT_REG_ALWAYS_DIRTY        (1<<0)
  26. #define  LEPC_OPT_REG_NO_ARGUMENTS        (1<<1)
  27.  
  28. /****************************************************************************/
  29. /**   @function iteration options                                          **/
  30. /****************************************************************************/
  31. #define  LEPC_OPT_LOOP_NONE               0
  32. #define  LEPC_OPT_LOOP_EMPTY_CELLS        (1<<0)
  33.  
  34. /****************************************************************************/
  35. /**   range coordinate constants                                           **/
  36. /****************************************************************************/
  37. #define  LEPC_COORD_DIMEN                 3
  38. #define  LEPC_COORD_SHEET                 0
  39. #define  LEPC_COORD_COLUMN                1
  40. #define  LEPC_COORD_ROW                   2
  41.  
  42. /****************************************************************************/
  43. /**   macro command argument prototype values                              **/
  44. /****************************************************************************/
  45. #define  LEPC_PROT_TYPE_MASK              0x00FF
  46. #define  LEPC_PROT_TYPE_BASE              0
  47. #define  LEPC_PROT_TYPE_STRING            (LEPC_PROT_TYPE_BASE+0)
  48. #define  LEPC_PROT_TYPE_NUMBER            (LEPC_PROT_TYPE_BASE+1)
  49. #define  LEPC_PROT_TYPE_CONDITION         (LEPC_PROT_TYPE_BASE+2)
  50. #define  LEPC_PROT_TYPE_VALUE             (LEPC_PROT_TYPE_BASE+3)
  51. #define  LEPC_PROT_TYPE_RANGE             (LEPC_PROT_TYPE_BASE+4)
  52.  
  53. /****************************************************************************/
  54. /**   macro command argument prototype options                             **/
  55. /****************************************************************************/
  56. #define  LEPC_PROT_OPT_MASK               0xFF00
  57. #define  LEPC_PROT_OPT_OPTIONAL           (1<<8)
  58.  
  59. /****************************************************************************/
  60. /**   @function and macro command argument and cell value types            **/
  61. /****************************************************************************/
  62. #define  LEPC_TYPE_BASE                   0
  63. #define  LEPC_TYPE_VALUE                  (LEPC_TYPE_BASE+0)
  64. #define  LEPC_TYPE_TINY                   (LEPC_TYPE_BASE+1)
  65. #define  LEPC_TYPE_SHORT                  (LEPC_TYPE_BASE+2)
  66. #define  LEPC_TYPE_LONG                   (LEPC_TYPE_BASE+3)
  67. #define  LEPC_TYPE_FLOAT                  (LEPC_TYPE_BASE+4)
  68. #define  LEPC_TYPE_DOUBLE                 (LEPC_TYPE_BASE+5)
  69. #define  LEPC_TYPE_TREAL                  (LEPC_TYPE_BASE+6)
  70. #define  LEPC_TYPE_ERR                    (LEPC_TYPE_BASE+7)
  71. #define  LEPC_TYPE_NA                     (LEPC_TYPE_BASE+8)
  72. #define  LEPC_TYPE_EMPTY                  (LEPC_TYPE_BASE+9)
  73. #define  LEPC_TYPE_STRING                 (LEPC_TYPE_BASE+10)
  74. #define  LEPC_TYPE_RANGE                  (LEPC_TYPE_BASE+11)
  75. #define  LEPC_TYPE_COLLECTION             (LEPC_TYPE_BASE+12)
  76. #define  LEPC_TYPE_MISSING                (LEPC_TYPE_BASE+13)
  77.  
  78. #define  LEPC_MAX_STRING                  513
  79.  
  80. /****************************************************************************/
  81. /**   External Programming Manager return codes                            **/
  82. /****************************************************************************/
  83. #define  LEPC_RET_BASE                    0
  84. #define  LEPC_RET_SUCCESS                 (LEPC_RET_BASE+0)
  85. #define  LEPC_RET_LOOP_DONE               (LEPC_RET_BASE+1)
  86. #define  LEPC_RET_DUPLICATE_NAME          (LEPC_RET_BASE+2)
  87. #define  LEPC_RET_ARGUMENT_OVERFLOW       (LEPC_RET_BASE+3)
  88. #define  LEPC_RET_NUMERIC_OVERFLOW        (LEPC_RET_BASE+4)
  89. #define  LEPC_RET_TRUNCATED_NUMBER        (LEPC_RET_BASE+5)
  90. #define  LEPC_RET_TRUNCATED_STRING        (LEPC_RET_BASE+6)
  91. #define  LEPC_RET_INVALID_ACTION          (LEPC_RET_BASE+7)
  92. #define  LEPC_RET_INVALID_ARGUMENT        (LEPC_RET_BASE+8)
  93. #define  LEPC_RET_INVALID_CELL            (LEPC_RET_BASE+9)
  94. #define  LEPC_RET_INVALID_INDEX           (LEPC_RET_BASE+10)
  95. #define  LEPC_RET_INVALID_LOOP            (LEPC_RET_BASE+11)
  96. #define  LEPC_RET_INVALID_NAME            (LEPC_RET_BASE+12)
  97. #define  LEPC_RET_INVALID_PROTOTYPE       (LEPC_RET_BASE+13)
  98. #define  LEPC_RET_INVALID_RANGE           (LEPC_RET_BASE+14)
  99. #define  LEPC_RET_INVALID_SIZE            (LEPC_RET_BASE+15)
  100. #define  LEPC_RET_INVALID_TYPE            (LEPC_RET_BASE+16)
  101. #define  LEPC_RET_MEMORY_ERROR            (LEPC_RET_BASE+17)
  102.  
  103. /****************************************************************************/
  104. /**   data type for external programming API and callback functions        **/
  105. /****************************************************************************/
  106. #define  LEPC_API                         _System
  107.  
  108. /****************************************************************************/
  109. /**   Data Types                                                           **/
  110. /****************************************************************************/
  111.  
  112. /****************************************************************************/
  113. /**   callback function prototypes for the Library Manager,                **/
  114. /**   and the @function and macro command implementation functions         **/
  115. /****************************************************************************/
  116. typedef  PVOID (* LEPC_API LEPTPFNMANAGER)(PVOID, USHORT);
  117. typedef  VOID  (* LEPC_API LEPTPFNFUNCTION)(PVOID, USHORT);
  118. typedef  VOID  (* LEPC_API LEPTPFNCOMMAND)(PVOID, USHORT);
  119.  
  120. /****************************************************************************/
  121. /**   Function Prototypes                                                  **/
  122. /****************************************************************************/
  123.  
  124. /****************************************************************************/
  125. /**   Customized @Function API                                             **/
  126. /****************************************************************************/
  127.  
  128. /****************************************************************************/
  129. /**   register an @function                                                **/
  130. /****************************************************************************/
  131. USHORT LEPC_API LepAfRegisterFunction( PSZ               pszName,
  132.                                        LEPTPFNFUNCTION   pfnFunction,
  133.                                        USHORT            fsOptions,
  134.                                        PVOID             pData,
  135.                                        PSZ               pszHelp  );
  136.  
  137. /****************************************************************************/
  138. /**   get the type and size of an @function argument                       **/
  139. /****************************************************************************/
  140. USHORT LEPC_API LepAfGetArgType( USHORT   iArgument,
  141.                                  PUSHORT  pusType,
  142.                                  PUSHORT  pusSize  );
  143.  
  144. /****************************************************************************/
  145. /**   get the value of an @function argument                               **/
  146. /****************************************************************************/
  147. USHORT LEPC_API LepAfGetArgValue(   USHORT   iArgument,
  148.                                     USHORT   usType,
  149.                                     USHORT   usSize,
  150.                                     PVOID    pValue   );
  151.  
  152. /****************************************************************************/
  153. /**   begin iterating through the cells in a range or collection           **/
  154. /****************************************************************************/
  155. USHORT LEPC_API LepAfBeginRangeLoop(   PVOID       pRange,
  156.                                        USHORT      fsOptions,
  157.                                        PVOID       *ppLoop  );
  158.    
  159. /****************************************************************************/
  160. /**   move to the next cell in a range or collection                       **/
  161. /****************************************************************************/
  162. USHORT LEPC_API LepAfNextLoopCell(  PVOID    pLoop );
  163.    
  164. /****************************************************************************/
  165. /**   get the type and size of the current cell in a range or collection   **/
  166. /****************************************************************************/
  167. USHORT LEPC_API LepAfGetLoopType(   PVOID    pLoop,
  168.                                     PUSHORT  pusType,
  169.                                     PUSHORT  pusSize  );
  170.    
  171. /****************************************************************************/
  172. /**   get the value of the current cell in a range or collection           **/
  173. /****************************************************************************/
  174. USHORT LEPC_API LepAfGetLoopValue(  PVOID    pLoop,
  175.                                     USHORT   usType,
  176.                                     USHORT   usSize,
  177.                                     PVOID    pValue   );
  178.    
  179. /****************************************************************************/
  180. /**   finish iterating through the cells in a range or collection          **/
  181. /****************************************************************************/
  182. USHORT LEPC_API LepAfEndRangeLoop(  PVOID pLoop );
  183.    
  184. /****************************************************************************/
  185. /**   get the dimensions of a range                                        **/
  186. /****************************************************************************/
  187. USHORT LEPC_API LepAfGetRangeDimen( PVOID       pRange,
  188.                                     USHORT      ausDimen[LEPC_COORD_DIMEN] );
  189.    
  190. /****************************************************************************/
  191. /**   get the type and size of a cell in a range specified by coordinates  **/
  192. /****************************************************************************/
  193. USHORT LEPC_API LepAfGetCellType(   PVOID       pRange,
  194.                                     USHORT      ausCoord[LEPC_COORD_DIMEN],
  195.                                     PUSHORT     pusType,
  196.                                     PUSHORT     pusSize  );
  197.    
  198. /****************************************************************************/
  199. /**   get the value of a cell in a range specified by coordinates          **/
  200. /****************************************************************************/
  201. USHORT LEPC_API LepAfGetCellValue(  PVOID       pRange,
  202.                                     USHORT      ausCoord[LEPC_COORD_DIMEN],
  203.                                     USHORT      usType,
  204.                                     USHORT      usSize,
  205.                                     PVOID       pValue   );
  206.    
  207. /****************************************************************************/
  208. /**   return a value to the cell or formula containing the @function       **/
  209. /****************************************************************************/
  210. USHORT LEPC_API LepAfReturnValue(   USHORT   usType,  
  211.                                     USHORT   usSize,
  212.                                     PVOID    pValue   );
  213.  
  214. /****************************************************************************/
  215. /**   Customized Macro Commmand API                                        **/
  216. /****************************************************************************/
  217.  
  218. /****************************************************************************/
  219. /**   register a  macro commmand                                           **/
  220. /****************************************************************************/
  221. USHORT LEPC_API LepMcRegisterCommand(  PSZ               pszName,
  222.                                        LEPTPFNCOMMAND    pfnCommand,
  223.                                        USHORT            fsOptions,
  224.                                        USHORT            cusArguments,
  225.                                        USHORT            ausPrototype[],
  226.                                        PVOID             pData,
  227.                                        PSZ               pszHelp  );
  228.  
  229. /****************************************************************************/
  230. /**   get the type and size of a macro commmand argument                   **/
  231. /****************************************************************************/
  232. USHORT LEPC_API LepMcGetArgType( USHORT   iArgument,
  233.                                  PUSHORT  pusType,
  234.                                  PUSHORT  pusSize  );
  235.  
  236. /****************************************************************************/
  237. /**   get the value of a macro commmand argument                           **/
  238. /****************************************************************************/
  239. USHORT LEPC_API LepMcGetArgValue(   USHORT   iArgument,
  240.                                     USHORT   usType,
  241.                                     USHORT   usSize,
  242.                                     PVOID    pValue   );
  243.  
  244. /****************************************************************************/
  245. /**   get the dimensions of a range                                        **/
  246. /****************************************************************************/
  247. USHORT LEPC_API LepMcGetRangeDimen( PVOID       pRange,
  248.                                     USHORT      ausDimen[LEPC_COORD_DIMEN] );
  249.    
  250. /****************************************************************************/
  251. /**   get the type and size of a cell in a range specified by coordinates  **/
  252. /****************************************************************************/
  253. USHORT LEPC_API LepMcGetCellType(   PVOID       pRange,
  254.                                     USHORT      ausCoord[LEPC_COORD_DIMEN],
  255.                                     PUSHORT     pusType,
  256.                                     PUSHORT     pusSize  );
  257.    
  258. /****************************************************************************/
  259. /**   get the value of a cell in a range specified by coordinates          **/
  260. /****************************************************************************/
  261. USHORT LEPC_API LepMcGetCellValue(  PVOID       pRange,
  262.                                     USHORT      ausCoord[LEPC_COORD_DIMEN],
  263.                                     USHORT      usType,
  264.                                     USHORT      usSize,
  265.                                     PVOID       pValue   );
  266.    
  267. /****************************************************************************/
  268. /**   set the value of a cell in a range specified by coordinates          **/
  269. /****************************************************************************/
  270. USHORT LEPC_API LepMcSetCellValue(  PVOID       pRange,
  271.                                     USHORT      ausCoord[LEPC_COORD_DIMEN],
  272.                                     USHORT      usType,
  273.                                     USHORT      usSize,
  274.                                     PVOID       pValue   );
  275.  
  276. /****************************************************************************/
  277. /**   display an error message in a macro program                          **/
  278. /****************************************************************************/
  279. USHORT LEPC_API LepMcDisplayError(  PUCHAR   puchError   );
  280.  
  281. #endif
  282.