#include <as400_protos.h> int _ILECALLX(const ILEpointer *target, ILEarglist_base *ILEarglist, const arg_type_t *signature, result_type_t result_type, int flags); int _ILECALL(const ILEpointer *target, ILEarglist_base *ILEarglist, const arg_type_t *signature, result_type_t result_type);
Note: These functions can only be used in an IBM® i PASE program. See the IBM PASE for i topic collection for more information.
The _ILECALLX() and _ILECALL() functions call an ILE procedure from an IBM PASE for i program. They transfer control to an ILE procedure specified by a 16-byte tagged ILE procedure pointer, passing arguments and returning the function result.
The base structure of an ILE argument list (including a function result area) is specified by type ILEarglist_base. Any argument values for the ILE procedure are stored in memory immediately following the ILEarglist_base type. The specific format of the argument list is determined by the list of arg_type_t values addressed by the signature argument. The alignment requirements for each argument value in the ILE argument list depends on its length:
Argument Length | Alignment |
---|---|
1 byte | any |
2 bytes | 2 bytes |
3-4 bytes | 4 bytes |
5-8 bytes | 8 bytes |
9 or more bytes | 16 bytes |
ARG_END (0) | Specifies the end of the signature list. |
ARG_INT8 (-1) | Signed 1-byte integer argument. |
ARG_UINT8 (-2) | Unsigned 1-byte integer argument. |
ARG_INT16 (-3) | Signed 2-byte integer argument. |
ARG_UINT16 (-4) | Unsigned 2-byte integer argument. |
ARG_INT32 (-5) | Signed 4-byte integer argument. |
ARG_UINT32 (-6) | Unsigned 4-byte integer argument. |
ARG_INT64 (-7) | Signed 8-byte integer argument. |
ARG_UINT64 (-8) | Unsigned 8-byte integer argument. |
ARG_FLOAT32 (-9) | 4-byte floating-point argument. |
ARG_FLOAT64 (-10) | 8-byte floating-point argument. |
ARG_FLOAT128 (-18) | 16-byte floating-point argument. |
ARG_MEMPTR (-11) | The argument is a field of type ILEpointer into which the caller has stored an IBM PASE for i memory address (in member address). _ILECALLX and _ILECALL convert the IBM PASE for i memory address to an equivalent teraspace address, except that address zero is converted to a special value for a null pointer. The converted result is passed as the argument value to the target ILE procedure. Both functions may update the ILEpointer value so it contains a tagged space pointer. |
ARG_SPCPTR (-12) | The argument is a field of type ILEpointer where the IBM PASE for i program has stored a tagged space pointer (or an untagged or null pointer). |
ARG_SPCPTRI (-16) | The argument is a field of type ILEpointer into which the caller has stored the IBM PASE for i memory address (in member address) of a tagged space pointer (or an untagged or null pointer) that is passed to the target ILE procedure. The ILEpointer in the argument list may be overlayed with a copy of the space pointer. |
ARG_OPENPTR (-13) | The argument is a field of type ILEpointer where the IBM PASE for i program has stored a 16-byte pointer of any type (including possibly an untagged or null pointer). |
ARG_OPENPTRI (-17) | The argument is a field of type ILEpointer into which the caller has stored the IBM PASE for i memory address (in member address) of a 16-byte pointer of any type (including possibly an untagged or null pointer) that is copied into the argument list (overlaying the original ILEpointer value) and passed as the argument to the target ILE procedure. |
ARG_MEMTS64 (-14) | The argument is a field of type ts64_t into which the caller has stored an IBM PASE for i memory address. _ILECALLX and _ILECALL convert the IBM PASE for i memory address to an equivalent 64-bit teraspace pointer, except that null (address zero) is unchanged. The converted result is passed as the argument value to the target ILE procedure. The ts64_t value in the argument list may be overlayed with the converted address. |
ARG_TS64PTR (-15) | The argument is a field of type ts64_t where the IBM PASE for i program has stored a 64-bit teraspace address. |
Any positive number (1-32767) |
The argument is an aggregate (structure or union). The value in the signature list is the length, in bytes, of the aggregate. |
The following values are supported:
RESULT_VOID(0) | No function result. | |
RESULT_INT8 (-1) | Signed 1-byte integer result, returned in field result.s_int8.r_int8 in the ILEarglist argument. | |
RESULT_UINT8 (-2) | Unsigned 1-byte integer result, returned in field result.s_uint8.r_uint8 in the ILEarglist argument. | |
RESULT_INT16 (-3) | Signed 2-byte integer result, returned in field result.s_int16.r_int16 in the ILEarglist argument. | |
RESULT_UINT16 (-4) | Unsigned 2-byte integer result, returned in field result.s_uint16.r_uint16 in the ILEarglist argument. | |
RESULT_INT32 (-5) | Signed 4-byte integer result, returned in field result.s_int32.r_int32 in the ILEarglist argument. | |
RESULT_UINT32 (-6) | Unsigned 4-byte integer result, returned in field result.s_uint32.r_uint32 in the ILEarglist argument. | |
RESULT_INT64 (-7) | Signed 8-byte integer result, returned in field result.r_int64 in the ILEarglist argument. | |
RESULT_UINT64 (-8) | Unsigned 8-byte integer result, returned in field result.r_uint64 in the ILEarglist argument. | |
RESULT_FLOAT64 (-10) | 8-byte floating-point result, returned in field result.r_float64 in the ILEarglist argument. | |
RESULT_FLOAT128 (-18) | 16-byte floating-point result, returned in field result.r_float128 in the ILEarglist argument. | |
Any positive number (1-32767) |
The function result is an aggregate (structure or union). result_type is the length, in bytes, of the aggregate. An aggregate function result is returned in a buffer allocated by the caller and passed to the target ILE procedure using a special field in the argument list. The caller must provide a buffer large enough for the result returned by the target ILE procedure to avoid unpredictable results. An IBM PASE for i program must set field result.r_aggregate.addr in type ILEarglist_base to the IBM PASE for i memory address of the result buffer before calling an ILE procedure that returns an aggregate result. _ILECALLX and _ILECALL convert the IBM PASE for i memory address to a teraspace address the same way they convert ARG_MEMPTR arguments. |
ILECALL_NOINTERRUPT (0x00000004) |
Specifies that IBM PASE for i signals will not interrupt the called ILE procedure. Some system functions (such as select) can be interrupted by signals. Normally either an ILE signal or an IBM PASE for i signal can interrupt such an operation, but ILECALL_NOINTERRUPT delays IBM PASE for i signal processing until control returns from the called ILE procedure. This option has no effect on ILE signal handling. |
ILECALL_EXCP_NOSIGNAL (0x00000020) |
Suppresses signals for IBM i exceptions. This option causes the system to return a function result of -1 (and set errno to 3474) instead of raising a signal for any exception during the call. You can use the QMHRCVPM()--Receive Program Message for IBM PASE for i function specifying message type *EXCP to determine what exception occurred. |
_ILECALL and _ILECALLX require no authority.
Most errors from _ILECALLX and _ILECALL are reported with IBM i exception messages that are converted to IBM PASE for i signals unless ILECALL_EXCP_NOSIGNAL is specified. See IBM PASE for i Signal Handling for information about handling IBM i exceptions.
If no IBM PASE for i signal is sent, one of these values is returned:
ILECALL_NOERROR(0) | The target ILE procedure was called and returned normally. |
ILECALL_INVALID_ARG (1) | An invalid value was found in the signature list. |
ILECALL_INVALID_RESULT (2) | The result_type value is invalid. |
ILECALL_INVALID_FLAGS (3) | The flags value is invalid. |