Synesis Software

dlopen() API
[Synesis Software UNIX Emulation for Win32]

This API provides facilities for manipulating dynamically loaded executable modules. More...

Defines

#define RTLD_LAZY   (0x00001)
#define RTLD_NOW   (0x00002)

Functions

void * dlopen (char const *moduleName, int mode)
 Loads the given module,.
int dlclose (void *hModule)
 Closes the given module.
void * dlsym (void *hModule, char const *symbolName)
 Looks up a symbol.
char const * dlerror (void)
 Returns a descriptive string for the last error.

Detailed Description

This API provides facilities for manipulating dynamically loaded executable modules.


Define Documentation

#define RTLD_LAZY   (0x00001)

Lazy function call binding.

#define RTLD_NOW   (0x00002)

Immediate function call binding.


Function Documentation

int dlclose ( void *  hModule  ) 

Closes the given module.

Parameters:
hModule The handle of the executable module to close
Return values:
0 success
!0 failure. dlerror() will return an error string

char const* dlerror ( void   ) 

Returns a descriptive string for the last error.

Returns:
A pointer to a string describing the last error, or NULL.
Return values:
NULL No error occured, or dlerror() already called
Note:
Each call to this function resets it, so that a second call will always return NULL

void* dlopen ( char const *  moduleName,
int  mode 
)

Loads the given module,.

Parameters:
moduleName The name of the module. The name is passed through to Win32's LoadLibrary(), so the value of this parameter is interpreted according to Win32's loading rules.
mode The loading mode. This is ignored on Win32 platforms, and the function always behaves as if RTLD_NOW was specified
Note:

void* dlsym ( void *  hModule,
char const *  symbolName 
)

Looks up a symbol.

Parameters:
hModule The handle of the executable module in which to search for the symbol
symbolName The name of the symbol
Returns:
The pointer to the symbol, or NULL if no matching symbol was found
Return values:
NULL The symbol was not found


UNIX Emulation for Win32 Libraries documentation © Synesis Software Pty Ltd, 2002-2007