_ILESYMX() and _ILESYM()--Find an Exported ILE Symbol for IBM PASE for i


  Syntax
 #include <as400_protos.h>


 int _ILESYMX(ILEpointer          *export,
              unsigned long long  actmark,
              const char          *symbol);  


 int _ILESYM(ILEpointer  *export,
             int         actmark,
             const char  *symbol);  

  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 about creating IBM PASE for i programs.

The _ILESYMX() and _ILESYM() functions find an exported symbol in the activation of an ILE bound program and return a 16-byte tagged pointer to the data or procedure for the symbol.


Parameters

export
(Output) Pointer to a 16-byte aligned buffer for the tagged pointer return value. The export buffer used to store a tagged pointer to the data or procedure for the exported symbol.

actmark
(Input) Specifies an activation mark that identifies the activation (in the current IBM i job) to search for the symbol. A value of zero causes the system to search all activations in the activation group that started IBM PASE for i (either the activation group that called the Qp2RunPase API, or the default activation group for a job running program QP2FORK). The _ILELOADX and _ILELOAD functions return an activation mark when they load a bound program. 64-bit activation mark values can only be handled by _ILESYMX and _ILELOADX.

symbol
(Input) Pointer to the symbol name to find. symbol is the address of a null-terminated character string in the IBM PASE for i CCSID that specifies the name of a symbol exported by the actmark activation.

Authorities

_ILESYMX and _ILESYM call the ILE QleGetExpLong API to find the exported symbol. See Get Export Long (QleGetExpLong) API for information about authorities required to use _ILESYMX and _ILESYM.


Return Value

A function result of -1 indicates an error that is further qualified by an errno value. If the symbol was successfully found, the export pointer is set to the address of the function or data for the symbol, and the function result is set to one of these values:

ILESYM_PROCEDURE (1) The export return value is a tagged pointer to an ILE procedure. An ILE procedure pointer can be used with the _ILECALLX function to call the ILE procedure.
ILESYM_DATA(2) The export return value is a tagged space pointer to a data item in the ILE activation.


Error Conditions

Memory errors and errors during ILE symbol resolution processing may be reported with an IBM i exception message that the system converts to an IBM PASE for i signal (not return code and errno values). See IBM PASE for i Signal Handling for information about handling IBM i exceptions.

At least these errno values can be returned, with other values also possible (such as IBM i-unique ILE errno EAPAR):

[EACCES] Not authorized to the actmark activation.
[ENOENT] The symbol was not found in the actmark activation.


Related Information


API introduced: V4R5

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