Kanzi 3.9.10
kzs_dynamic_library.hpp File Reference

System header. More...

Macros

#define KZ_LOG_CATEGORY_DYNAMIC_LIBRARY
 Logging category for dynamic library.
 

Typedefs

typedef void(* PFNDYNAMICLIBRARYMUSTCASTPROC) (void)
 Pointer to any function.
 

Functions

void kzsDynamicLibraryClose (struct KzsDynamicLibrary *library)
 Destroys a KzsDynamicLibrary object and releases all resources associated with it.
 
PFNDYNAMICLIBRARYMUSTCASTPROC kzsDynamicLibraryGetProcAddress (struct KzsDynamicLibrary *library, const char *symbolName)
 Retrieves function addresses of the dynamic library.
 
bool kzsDynamicLibraryIsLoaded (const struct KzsDynamicLibrary *library)
 Checks if the dynamic library loading was successful.
 
struct KzsDynamicLibrary * kzsDynamicLibraryOpen (const char *path)
 Creates a KzsDynamicLibrary object and tries to load the library specified by the path parameter.
 

Detailed Description

System header.

Copyright 2008-2017 by Rightware. All rights reserved.

Macro Definition Documentation

◆ KZ_LOG_CATEGORY_DYNAMIC_LIBRARY

#define KZ_LOG_CATEGORY_DYNAMIC_LIBRARY

Logging category for dynamic library.

Typedef Documentation

◆ PFNDYNAMICLIBRARYMUSTCASTPROC

typedef void(* PFNDYNAMICLIBRARYMUSTCASTPROC) (void)

Pointer to any function.

Cast into the correct function type before using the value.

Function Documentation

◆ kzsDynamicLibraryOpen()

struct KzsDynamicLibrary * kzsDynamicLibraryOpen ( const char * path)

Creates a KzsDynamicLibrary object and tries to load the library specified by the path parameter.

Use kzsDynamicLibraryIsLoaded() to check if the loading actually succeeded. After successful loading you can retrieve function addresses of the library using kzsDynamicLibraryGetProcAddress(). Destroy KzsDynamicLibrary objects after use with kzsDynamicLibraryClose().

Parameters
pathPath to the library to load.
Returns
Returns newly created KzsDynamicLibrary object.
See also
kzsDynamicLibraryClose(), kzsDynamicLibraryIsLoaded(), and kzsDynamicLibraryGetProcAddress().

◆ kzsDynamicLibraryClose()

void kzsDynamicLibraryClose ( struct KzsDynamicLibrary * library)

Destroys a KzsDynamicLibrary object and releases all resources associated with it.

Parameters
libraryThe library to destroy.

◆ kzsDynamicLibraryIsLoaded()

bool kzsDynamicLibraryIsLoaded ( const struct KzsDynamicLibrary * library)

Checks if the dynamic library loading was successful.

Parameters
libraryThe library to check.
Returns
True, if the dynamic library was successfully loaded.

◆ kzsDynamicLibraryGetProcAddress()

PFNDYNAMICLIBRARYMUSTCASTPROC kzsDynamicLibraryGetProcAddress ( struct KzsDynamicLibrary * library,
const char * symbolName )

Retrieves function addresses of the dynamic library.

Parameters
libraryThe library to search.
symbolNameName of the function to search for.
Returns
Pointer to the function, or null on failure.