HP-UX Linker and Libraries User's Guide

Parameters
The handle of the shared library whose symbols you want to retrieve. If handle is NULL,
shl_getsymbols returns symbols that were defined with the shl_definesym routine.
handle
Defines the type of symbol to retrieve. It must be one of the following values, which are defined as
constants in <dl.h>:
type
Retrieve only function or procedure symbols.TYPE_PROCEDURE
Retrieve only symbols from the data segment (for example, variables).TYPE_DATA
Retrieve all symbols, regardless of type.TYPE_UNDEFINED
same as TYPE_DATATYPE_STORAGE
Defines whether to retrieve import or export symbols from the library. An import symbol is an external
reference made from a library. An export symbol is a symbol definition that is referenced outside the
flags
library. In addition, any symbol defined by shl_definesym is an export symbol. Set this argument
to one of the following values (defined in <dl.h>):
To return import symbols.IMPORT_SYMBOLS
To return export symbols.EXPORT_SYMBOLS
To return initializer symbols.INITIALIZERS
One of the following modifiers can be alternated with both the EXPORT_SYMBOLS and the
INITIALIZERS flags:
Do not calculate the value field of the shl_symbol structure for symbols.
The value field has an undefined value.
NO_VALUES
For symbols that are defined in multiple libraries, this flag causes
shl_getsymbols to return the most-visible occurrence, and to set the value
GLOBAL_VALUES
and handle fields of the shl_symbol structure (defined in the description
of the symbols parameter).
Points to a function that has the same interface (calling conventions and return value) as malloc(3C).
The shl_getsymbols function uses this function to allocate memory to store the array of symbol
records, symbols.
memfunc
This points to an array of symbol records for all symbols that match the criteria determined by the type
and value parameters. The type of these records is struct shl_symbol, defined in <dl.h> as:
symbols
struct shl_symbol {
char * name;
short type;
void * value;
shl_t handle;
};
The members of this structure are described in “The shl_symbol Structure (page 180).
Return Value
If successful, shl_getsymbols returns the number of symbols found; otherwise, -1 is returned
and shl_getsymbols sets errno to one of these values:
A format error was detected in the specified library.ENOEXEC
Some symbol required by the shared library cannot be found.ENOSYM
The specified handle is invalid.EINVAL
memfunc failed to allocate the requested memory.ENOMEM
The shl_load Shared Library Management Routines 179