_ILECALLX() and _ILECALL()--Call an ILE Procedure for IBM PASE for i



  Syntax
 #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);

  Default Public Authority: *USE

  Library: Standard C Library (libc.a)

  Threadsafe: Yes

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.


Parameters

target
(Input) Pointer to a tagged procedure pointer that addresses the ILE procedure to call. target must be a 16-byte aligned IBM PASE for i memory address.

ILEarglist
(Input/Output) Pointer to a 16-byte aligned ILE argument list structure. ILEarglist is the address of the structure that contains any argument values to pass to the ILE procedure, as well as memory for a function result returned by the ILE procedure. ILEarglist must be long enough to contain all arguments required by the target ILE procedure to avoid unpredictable results.

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:

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 _ILECALLX or _ILECALL 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:



result_type
(Input) Specifies the type of function result returned by the ILE procedure.

The following values are supported:



flags
(Input) Specifies options to control how the ILE procedure program is called. The flags argument is a bitwise logical-or of one or more of the following values:



Authorities

_ILECALL and _ILECALLX require no authority.


Return Value

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:



Usage Notes

  1. _ILECALLX and _ILECALL can only call ILE procedures in an IBM i bound program. If your IBM PASE for i program needs to call an IBM i program object (object type *PGM), you must use the _PGMCALL function or use the systemCL function to run the CL CALL command.

  2. _ILECALLX and _ILECALL do 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.

  3. An IBM PASE for i program can pass tagged space pointer arguments to an ILE procedure using either ARG_SPCPTR or ARG_OPENPTR unless the target ILE procedure uses ARGOPT linkage, in which case ARG_SPCPTR must be used. ARG_MEMPTR can be used for space pointer arguments regardless of what linkage is used by the target ILE procedure.

  4. ILE procedure pointers address resources inside an ILE activation group. The machine prohibits use of activation group resources from a process other than the owner of the activation group. This means that the child process of a fork cannot use ILE procedure pointers inherited from the parent process. The child process can, however, use _ILELOADX to load the bound program (creating a new activation in the child process) and then use _ILESYMX to obtain ILE procedure pointers into the new activation.

  5. See Set Space Pointer for IBM PASE for i (_SETSPP) for more information about tagged space pointers and sharing tagged pointers between processes.

  6. _ILECALL is equivalent to _ILECALLX with the ILECALL_NOINTERRUPT flag.


Related Information



API introduced: V4R5

[ Back to top | IBM PASE for i APIs | APIs by category ]