Skip to content
Steven Arnow edited this page May 4, 2013 · 2 revisions

DARNIT_DYNLIB

DARNIT_DYNLIB is a handle for a dynamically linked and loaded library.

DARNIT_EXPORT is defined here, which is used as a platform independent way of exporting a function in a dll/so/dylib. Eg.

int DARNIT_EXPORT testapp_dynlib(int b) {

d_dynlib_open

DARNIT_DYNLIB *d_dynlib_open(const char *fname);

Opens a dynamically linked library with filename fname and returns a handle to it.

Arguments

  • fname - A relative path to the dynamically linked library to load

Return value Returns NULL on failure. Anything else is a valid handle for the library.

d_dynlib_get

void *d_dynlib_get(DARNIT_DYNLIB *lib, const char *symbol);

Gets the pointer to a symbol in the specified library.

Arguments

  • lib - The handle to the library to get the symbol from
  • symbol - Name of the symbol to look up

Return value Returns NULL on error. Anything else is a valid pointer to the requested symbol.

d_dynlib_close

DARNIT_DYNLIB *d_dynlib_close(DARNIT_DYNLIB *lib);

Unloads a library and invalidates all of its symbols.

Arguments

  • lib - The handle to the library to unload

Return value Returns NULL for compact pointer clearing.

Clone this wiki locally