libdspl-2.0
Digital Signal Processing Algorithm Library
DSPL-2.0 Dynamic linking functions.

Functions

void * dspl_load ()
 Perform dynamic linking and load libdspl-2.0 functions. More...
 
void dspl_free (void *handle)
 Cleans up the previously linked DSPL-2.0 dynamic library. More...
 

Detailed Description


This group describes the functions for DSPL-2.0 library using in an user applications. DSPL-2.0 is cross-platform library an uses common dynamic linking interface in Linux and Windows OS.

Function Documentation

◆ dspl_free()

void dspl_free ( void *  handle)

Cleans up the previously linked DSPL-2.0 dynamic library.


This cross-platform function clears the library libdspl.dll in Windows system and from the library libdspl.so on the Linux system. After cleaning the library, all functions will become unavailable.

Parameters
[in]handleHandle of the previously linked DSPL-2.0 library.
This pointer can be NULL, in this case no action are being produced.
Author
Bakhurin Sergey. www.dsplib.org

◆ dspl_load()

void * dspl_load ( )

Perform dynamic linking and load libdspl-2.0 functions.


This function attempts to link to the library libdspl.dll in Windows system and the libdspl.so library on the Linux system. The library is assumed to be in the same directory as the application. user, or the path to the library is registered in the operating path variables system.

Upon successful binding and loading of library functions, the handle is returned libraries, as well as in the address space of the application appear pointers to libdspl-2.0 functions.

Note
The returned handle is of type void *, which can be cast on Windows to type HINSTANCE. In practice, this is not necessary, because this the type is cast to HINSTANCE automatically if the compiler flag is set, indicating that the application is being built on Windows.

An example of a simple program that implements dynamic binding with DSPL-2.0.

#include <stdio.h>
#include <stdlib.h>
#include "dspl.h"
int main (int argc, char* argv[])
{
void *hdspl; // DSPL handle
hdspl = dspl_load (); // Dynamic linking
// Check the pointer. If `NULL`, then the link failed
if (! hdspl)
{
printf ("libdspl loading error! \n");
return -1;
}
// The link was successful, you can call the functions of DSPL-2.0
//Before correctly terminating the application, you must unlink
//library and clear memory.
dspl_free(hdspl);
return 0;
}
Author
Bakhurin Sergey. www.dsplib.org
void * dspl_load()
Perform dynamic linking and load libdspl-2.0 functions.
void dspl_free(void *handle)
Cleans up the previously linked DSPL-2.0 dynamic library.