build_ILEarglist()--Build an ILE Argument List for IBM PASE for i
Syntax
#include <as400_protos.h> int build_ILEarglist(ILEarglist_base *ILEarglist, const void *PASEarglist, const arg_type_t *signature);
Default Public Authority: *USE
Library: Standard C Library (libc.a)
Threadsafe: Yes
Note: This function can only be used in an IBM® i PASE program. See the IBM PASE for i topic collection for more information about creating IBM PASE for i programs.
The build_ILEarglist() function builds an ILE argument list using argument values copied from an IBM PASE for i function with the same signature.
Parameters
- ILEarglist
- (Output) Pointer to a 16-byte aligned buffer allocated by the caller for
the ILE argument list. ILEarglist must be long enough to contain all arguments
specified in the signature list.
- PASEarglist
- (Input) Pointer to the first argument passed to an IBM PASE for i function
that accepts arguments equivalent to those specified by the signature list.
- signature
- (Input) Pointer to a list of arg_type_t values that specify the sequence
and type of arguments passed to the ILE procedure. ILE procedures can accept a
maximum of 400 arguments. The actual number of arguments processed by the
build_ILEarglist function is determined by the number of entries in the
signature list, which is determined by the location of the first ARG_END value
in the list. The following values are supported in the signature list:
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 memory address. The IBM PASE for i procedure argument is an IBM PASE for i memory address that build_ILEarglist copies into the ILEpointer type value in the ILE argument list. See Call an ILE Procedure for IBM PASE for i (_ILECALLX) for more information about how ARG_MEMPTR arguments are handled. ARG_SPCPTRI (-16) The argument is a field of type ILEpointer into which this function will store 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_OPENPTRI (-17) The argument is a field of type ILEpointer into which this function will store 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 memory address. The IBM PASE for i procedure argument is an IBM PASE for i memory address that build_ILEarglist copies into the ts64_t type value in the ILE argument list. See Call an ILE Procedure for IBM PASE for i (_ILECALLX) for more information about how ARG_MEMTS64 arguments are handled. ARG_TS64PTR (-15) The argument is a 64-bit teraspace pointer. 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.
Authorities
build_ILEarglist requires no authority.
Return Value
build_ILEarglist returns the number of bytes used to build the ILE argument list (including storage for the ILEarglist_base type), or zero if an error was detected in the input arguments.
Usage Notes
- build_ILEarglist does no character encoding conversions,
so the IBM PASE for i program may need to convert argument and result character
strings between ASCII and EBCDIC. IBM PASE for i runtime function
iconv can be used for character conversions.
- build_ILEarglist does not support argument types
ARG_SPCPTR or ARG_OPENPTR (which are supported by _ILECALLX)
because the AIX® Application Binary Interface for
PowerPC® provides no way to ensure 16-byte alignment for arguments pushed onto
the stack.
- build_ILEarglist does not directly support aggregate
function results. You need to set result.r_aggregate.addr in the PASEarglist
structure to the address of a buffer where the ILE procedure will store the
aggregate result.
- Older versions of build_ILEarglist accepted additional arguments in an attempt to handle aggregate function results, but those arguments were removed because they cannot be supported reliably. If you need to compile source that passes the additional arguments, you must define macro OLD_build_ILEarglist and include <as400_types.h> to access the old support.
Related Information
- _ILECALLX() and _ILECALL()--Call an ILE Procedure for IBM i PASE for i
- size_ILEarglist()--Compute ILE Argument List Size for IBM PASE for i
API introduced: V4R5