ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

rexxapidefs.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 
39 /*----------------------------------------------------------------------------*/
40 /* */
41 /* Module Name: rexxapidefs.h */
42 /* */
43 /* ooRexx Common Definitions File */
44 /* */
45 /*----------------------------------------------------------------------------*/
46 
47 #ifndef REXXAPIDEFS_INCLUDED
48 #define REXXAPIDEFS_INCLUDED
49 
50 /*----------------------------------------------------------------------------*/
51 /* */
52 /* Common */
53 /* */
54 /*----------------------------------------------------------------------------*/
55 
56 /* This section defines return codes and constants for REXX calls */
57 
58 #define RXAUTOBUFLEN 256
59 
60 #define RXAPI_OK 0
61 #define RXAPI_MEMFAIL 1002
62 
63 /*** Call type codes for use on interpreter startup */
64 #define RXCOMMAND 0 /* Program called as Command */
65 #define RXSUBROUTINE 1 /* Program called as Subroutin*/
66 #define RXFUNCTION 2 /* Program called as Function */
67 #define RXMETHOD 3 /* Program called as Method */
68 #define RXSCRIPT 4 /* Program called as Script */
69 
70 /*** Drop Authority for RXSUBCOM interface */
71 
72 #define RXSUBCOM_DROPPABLE 0x00 /* handler to be dropped by all*/
73 #define RXSUBCOM_NONDROP 0x01 /* process with same PID as the*/
74  /* registrant may drop environ */
75 
76 /*** Return Codes from RXSUBCOM interface */
77 
78 #define RXSUBCOM_ISREG 0x01 /* Subcommand is registered */
79 #define RXSUBCOM_ERROR 0x01 /* Subcommand Ended in Error */
80 #define RXSUBCOM_FAILURE 0x02 /* Subcommand Ended in Failure */
81 #define RXSUBCOM_BADENTRY 1001 /* Invalid Entry Conditions */
82 #define RXSUBCOM_NOEMEM RXAPI_MEMFAIL /* failure in memory manager */
83 #define RXSUBCOM_BADTYPE 1003 /* Bad registration type. */
84 #define RXSUBCOM_NOTINIT 1004 /* API system not initialized. */
85 #define RXSUBCOM_OK 0 /* Function Complete */
86 #define RXSUBCOM_DUP 10 /* Duplicate Environment Name- */
87  /* but Registration Completed */
88 #define RXSUBCOM_MAXREG 20 /* Cannot register more */
89  /* handlers */
90 #define RXSUBCOM_NOTREG 30 /* Name Not Registered */
91 #define RXSUBCOM_NOCANDROP 40 /* Name not droppable */
92 #define RXSUBCOM_LOADERR 50 /* Could not load function */
93 #define RXSUBCOM_NOPROC 127 /* RXSUBCOM routine - not found*/
94 
95 /*** Function Codes for Variable Pool Interface (shvcode) */
96 
97 #define RXSHV_SET 0x00 /* Set var from given value */
98 #define RXSHV_FETCH 0x01 /* Copy value of var to buffer */
99 #define RXSHV_DROPV 0x02 /* Drop variable */
100 #define RXSHV_SYSET 0x03 /* Symbolic name Set variable */
101 #define RXSHV_SYFET 0x04 /* Symbolic name Fetch variable*/
102 #define RXSHV_SYDRO 0x05 /* Symbolic name Drop variable */
103 #define RXSHV_NEXTV 0x06 /* Fetch "next" variable */
104 #define RXSHV_PRIV 0x07 /* Fetch private information */
105 
106 /*** Return Codes for Variable Pool Interface */
107 
108 #define RXSHV_NOAVL 144 /* Interface not available */
109 
110 /*** Return Code Flags for Variable Pool Interface (shvret) */
111 
112 #define RXSHV_OK 0x00 /* Execution was OK */
113 #define RXSHV_NEWV 0x01 /* Variable did not exist */
114 #define RXSHV_LVAR 0x02 /* Last var trans via SHVNEXTV */
115 #define RXSHV_TRUNC 0x04 /* Truncation occurred-Fetch */
116 #define RXSHV_BADN 0x08 /* Invalid variable name */
117 #define RXSHV_MEMFL 0x10 /* Out of memory failure */
118 #define RXSHV_BADF 0x80 /* Invalid funct code (shvcode)*/
119 
120 /*** Registration Type Identifiers for Available Function Table */
121 
122 #define RXFUNC_DYNALINK 1 /* Function Available in DLL */
123 #define RXFUNC_CALLENTRY 2 /* Registered as mem entry pt.*/
124 
125 
126 /*** Return Codes from RxFunction interface */
127 
128 #define RXFUNC_OK 0 /* REXX-API Call Successful */
129 #define RXFUNC_DEFINED 10 /* Function Defined in AFT */
130 #define RXFUNC_NOMEM 20 /* Not Enough Mem to Add */
131 #define RXFUNC_NOTREG 30 /* Funct Not Registered in AFT*/
132 #define RXFUNC_MODNOTFND 40 /* Funct Dll Module Not Found */
133 #define RXFUNC_ENTNOTFND 50 /* Funct Entry Point Not Found*/
134 #define RXFUNC_NOTINIT 60 /* API not initialized */
135 #define RXFUNC_BADTYPE 70 /* Bad function type */
136 #define RXFUNC_NOEMEM RXAPI_MEMFAIL /* failure in memory manager */
137 
138 /*** Drop Authority for Rexx Exit interface */
139 
140 #define RXEXIT_DROPPABLE 0x00 /* handler to be dropped by all*/
141 #define RXEXIT_NONDROP 0x01 /* process with same PID as the*/
142  /* registrant may drop environ */
143 /*** Exit return actions */
144 
145 #define RXEXIT_HANDLED 0 /* Exit handled exit event */
146 #define RXEXIT_NOT_HANDLED 1 /* Exit passes on exit event */
147 #define RXEXIT_RAISE_ERROR (-1) /* Exit handler error occurred */
148 
149 /*** Return Codes from RXEXIT interface */
150 
151 #define RXEXIT_ISREG 0x01 /* Exit is registered */
152 #define RXEXIT_ERROR 0x01 /* Exit Ended in Error */
153 #define RXEXIT_FAILURE 0x02 /* Exit Ended in Failure */
154 #define RXEXIT_BADENTRY 1001 /* Invalid Entry Conditions */
155 #define RXEXIT_NOEMEM RXAPI_MEMFAIL /* failure in memory manager */
156 #define RXEXIT_BADTYPE 1003 /* Bad registration type. */
157 #define RXEXIT_NOTINIT 1004 /* API system not initialized. */
158 #define RXEXIT_OK 0 /* Function Complete */
159 #define RXEXIT_DUP 10 /* Duplicate Exit Name- */
160  /* but Registration Completed */
161 #define RXEXIT_MAXREG 20 /* Cannot register more */
162  /* handlers */
163 #define RXEXIT_NOTREG 30 /* Name Not Registered */
164 #define RXEXIT_NOCANDROP 40 /* Name not droppable */
165 #define RXEXIT_LOADERR 50 /* Could not load function */
166 #define RXEXIT_NOPROC 127 /* RXEXIT routine - not found */
167 
168 /* System Exit function and sub-function definitions */
169 
170 #define RXENDLST 0 /* End of exit list. */
171 #define RXFNC 2 /* Process external functions. */
172 #define RXFNCCAL 1 /* subcode value. */
173 #define RXCMD 3 /* Process host commands. */
174 #define RXCMDHST 1 /* subcode value. */
175 #define RXMSQ 4 /* Manipulate queue. */
176 #define RXMSQPLL 1 /* Pull a line from queue */
177 #define RXMSQPSH 2 /* Place a line on queue */
178 #define RXMSQSIZ 3 /* Return num of lines on queue*/
179 #define RXMSQNAM 20 /* Set active queue name */
180 #define RXSIO 5 /* Session I/O. */
181 #define RXSIOSAY 1 /* SAY a line to STDOUT */
182 #define RXSIOTRC 2 /* Trace output */
183 #define RXSIOTRD 3 /* Read from char stream */
184 #define RXSIODTR 4 /* DEBUG read from char stream */
185 #define RXSIOTLL 5 /* Return linelength(N/A OS/2) */
186 #define RXHLT 7 /* Halt processing. */
187 #define RXHLTCLR 1 /* Clear HALT indicator */
188 #define RXHLTTST 2 /* Test HALT indicator */
189 #define RXTRC 8 /* Test ext trace indicator. */
190 #define RXTRCTST 1 /* subcode value. */
191 #define RXINI 9 /* Initialization processing. */
192 #define RXINIEXT 1 /* subcode value. */
193 #define RXTER 10 /* Termination processing. */
194 #define RXTEREXT 1 /* subcode value. */
195 
196 #define RXEXF 12 /* scripting function call */
197 #define RXEXFCAL 1 /* subcode value. */
198 #define RXNOVAL 13 /* NOVALUE exit */
199 #define RXNOVALCALL 1
200 #define RXVALUE 14 /* VALUE function exit */
201 #define RXVALUECALL 1
202 #define RXOFNC 15 /* Process external functions using object values. */
203 #define RXOFNCCAL 1 /* subcode value. */
204 
205 
206 #define RXNOOFEXITS 16 /* 1 + largest exit number. */
207 
208 /*** Asynchronous Request Interface defines */
209 
210 /*** Return Codes from Asynchronous Request interface */
211 
212 #define RXARI_OK 0 /* Interface completed */
213 #define RXARI_NOT_FOUND 1 /* Target program not found */
214 #define RXARI_PROCESSING_ERROR 2 /* Error processing request */
215 
216 /*** Macro Space Interface defines */
217 
218 /*** Registration Search Order Flags */
219 
220 #define RXMACRO_SEARCH_BEFORE 1 /* Beginning of search order */
221 #define RXMACRO_SEARCH_AFTER 2 /* End of search order */
222 
223 
224 /*** Return Codes from RxMacroSpace interface */
225 
226 #define RXMACRO_OK 0 /* Macro interface completed */
227 #define RXMACRO_NO_STORAGE 1 /* Not Enough Storage Available*/
228 #define RXMACRO_NOT_FOUND 2 /* Requested function not found*/
229 #define RXMACRO_EXTENSION_REQUIRED 3 /* File ext required for save */
230 #define RXMACRO_ALREADY_EXISTS 4 /* Macro functions exist */
231 #define RXMACRO_FILE_ERROR 5 /* File I/O error in save/load */
232 #define RXMACRO_SIGNATURE_ERROR 6 /* Incorrect format for load */
233 #define RXMACRO_SOURCE_NOT_FOUND 7 /* Requested cannot be found */
234 #define RXMACRO_INVALID_POSITION 8 /* Invalid search order pos */
235 #define RXMACRO_NOT_INIT 9 /* API not initialized */
236 
237 /*** Request flags for External Data Queue access */
238 
239 #define RXQUEUE_FIFO 0 /* Access queue first-in-first-out */
240 #define RXQUEUE_LIFO 1 /* Access queue last-in-first-out */
241 
242 #define RXQUEUE_NOWAIT 0 /* Wait for data if queue empty */
243 #define RXQUEUE_WAIT 1 /* Don't wait on an empty queue */
244 
245 
246 /*** Return Codes from RxQueue interface */
247 
248 #define RXQUEUE_OK 0 /* Successful return */
249 #define RXQUEUE_NOTINIT 1000 /* Queues not initialized */
250 
251 #define RXQUEUE_STORAGE 1 /* Ret info buf not big enough */
252 #define RXQUEUE_SIZE 2 /* Data size > 64K-64 */
253 #define RXQUEUE_DUP 3 /* Attempt-duplicate queue name*/
254 #define RXQUEUE_NOEMEM RXAPI_MEMFAIL /* failure in memory manager */
255 #define RXQUEUE_BADQNAME 5 /* Not a valid queue name */
256 #define RXQUEUE_PRIORITY 6 /* Not accessed as LIFO|FIFO */
257 #define RXQUEUE_BADWAITFLAG 7 /* Not accessed as WAIT|NOWAIT */
258 #define RXQUEUE_EMPTY 8 /* No data in queue */
259 #define RXQUEUE_NOTREG 9 /* Queue does not exist */
260 #define RXQUEUE_ACCESS 10 /* Queue busy and wait active */
261 #define RXQUEUE_MAXREG 11 /* No memory to create a queue */
262 #define RXQUEUE_MEMFAIL RXAPI_MEMFAIL /* Failure in memory management*/
263 
264 #endif /* REXXAPIDEFS_INCLUDED */
265