Kenwood HP 9000 Personal Computer User Manual


 
232 Chapter 6
Shared Library Management Routines
The shl_load Shared Library Management Routines
Return Value
If successful, shl_definesym returns 0. Otherwise, it returns 1 and
sets errno accordingly. See shl_definesym(3X) for details.
Description
The shl_definesym function allows you to add a new symbol to the
global shared library symbol table. Use of this routine will be
unnecessary for most programmers.
There are two main reasons to add or change shared library symbol table
entries:
to generate symbol definitions as the program runs — for example,
aliasing one symbol with another
to override a current definition
Symbol definitions in the incomplete executable may also be redefined
with certain restrictions:
The incomplete executable always uses its own definition for any data
(storage) symbol, even if a more visible one is provided.
The incomplete executable only uses a more visible code symbol if the
main program itself does not provide a definition.
The shl_getsymbols Routine
The shl_getsymbols function retrieves symbols that are imported
(referenced) or exported (defined) by a shared library. This information is
returned in an allocated array of records, one for each symbol. Most
programmers do not need to use this routine.
Syntax
int shl_getsymbols( shl_t handle,
short type,
int flags,
void * (*memfunc)(),
struct shl_symbol **symbols )