ALSA project - the C library reference
Loading...
Searching...
No Matches
dlmisc.c File Reference

dynamic loader helpers More...

Functions

int snd_dlpath (char *path, size_t path_len, const char *name)
 Compose the dynamic path.
 
void * snd_dlopen (const char *name, int mode, char *errbuf, size_t errbuflen)
 Opens a dynamic library - ALSA wrapper for dlopen.
 
int snd_dlclose (void *handle)
 Closes a dynamic library - ALSA wrapper for dlclose.
 
void * snd_dlsym (void *handle, const char *name, const char *version)
 Resolves a symbol from a dynamic library - ALSA wrapper for dlsym.
 

Detailed Description

dynamic loader helpers

Author
Jaroslav Kysela perex.nosp@m.@per.nosp@m.ex.cz
Date
2001

Dynamic loader helpers

Function Documentation

◆ snd_dlclose()

int snd_dlclose ( void * handle)

Closes a dynamic library - ALSA wrapper for dlclose.

Parameters
handleLibrary handle, similar to dlclose.
Returns
Zero if successful, otherwise an error code.

This function can emulate dynamic linking for the static build of the alsa-lib library.

◆ snd_dlopen()

void * snd_dlopen ( const char * name,
int mode,
char * errbuf,
size_t errbuflen )

Opens a dynamic library - ALSA wrapper for dlopen.

Parameters
namename of the library, similar to dlopen.
modemode flags, similar to dlopen.
errbufa string buffer for the error message dlerror.
errbuflena length of the string buffer for the error message.
Returns
Library handle if successful, otherwise NULL.

This function can emulate dynamic linking for the static build of the alsa-lib library. In that case, name is set to NULL.

◆ snd_dlpath()

int snd_dlpath ( char * path,
size_t path_len,
const char * name )

Compose the dynamic path.

Parameters
pathReturned path (string)
path_lenReturned path max size (with trailing zero)
namePlugin name (relative)
Returns
Zero on success, otherwise a negative error code

◆ snd_dlsym()

void * snd_dlsym ( void * handle,
const char * name,
const char * version )

Resolves a symbol from a dynamic library - ALSA wrapper for dlsym.

Parameters
handleLibrary handle, similar to dlsym.
nameSymbol name.
versionVersion of the symbol.

This function can emulate dynamic linking for the static build of the alsa-lib library.

This special version of the dlsym function checks also the version of the symbol. A versioned symbol should be defined using the SND_DLSYM_BUILD_VERSION macro.