dsl

Contents

dsl#

Portable macros for dynamic shared libraries.

This header declares some macros for working with dynamic shared libraries in a portable way (POSIX and Windows). On POSIX systems one should link with -ldl.

Macro prototypes

dsl_handle dsl_open(const char *filename);
Opens shared library filename and returns a new handle or NULL on error.

void *dsl_sym(dsl_handle handle, const char *symbol);
Returns a pointer to symbol in a shared library or NULL on error.

const char *dsl_error(void);
Returns a pointer to a human-readable string describing the most recent error or NULL if no errors have occurred since the last call to dsl_error().

int dsl_close(dsl_handle handle);
Closes a handle. Returns non-zero on error.

Defines

DSL_Posix#
DSL_Windows#
DSL_EXPORT#
DSL_IMPORT#
dsl_open(filename)#
dsl_sym(handle, symbol)#
dsl_error()#
dsl_close(handle)#

Typedefs

typedef void *dsl_handle#