![]() |
TEL
Create your extensible application
|
Add extension structure and functions. More...
#include <APIMacros/api.h>
#include <stddef.h>
#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | TelError |
The structure that represents the error on return. More... | |
struct | TelExtension |
The structure that represents the extension. More... |
Macros | |
#define | TEL_ERROR_NO 0 |
#define | TEL_ERROR_GET_FUNC 1 |
#define | TEL_ERROR_EXT_LOAD 2 |
#define | TEL_NEW_EXTENSION(extension, struct) |
Macro that create TelExtension. |
Functions | |
API TelError | telExtensionLoad (TelExtension *self, const char *restrict path, const char *restrict setupFunctionName) |
Function that loads the extension. | |
API TelError | telExtensionUnload (TelExtension *self, const char *restrict cleanupFunctionName) |
Function that unload the extension. |
Add extension structure and functions.
This file contains the basic functions and structures of TEL. It allows you to load and unload extensions.
#define TEL_ERROR_EXT_LOAD 2 |
#define TEL_ERROR_GET_FUNC 1 |
#define TEL_ERROR_NO 0 |
#define TEL_NEW_EXTENSION | ( | extension, | |
struct ) |
Macro that create TelExtension.
@macro TEL_NEW_EXTENSION
The macro that allocate memory for extension and info.
extension | Name of TelExtension variable. |
struct | Name of info structure. |
API TelError telExtensionLoad | ( | TelExtension * | self, |
const char *restrict | path, | ||
const char *restrict | setupFunctionName ) |
Function that loads the extension.
The function that loads the extension, processes the setup function, and allocates memory for the extension information.
self | Extension over which actions are performed. |
path | Path to extension (shared library). |
setupFunctionName | Name of the setup function in the extension (requires the information parameter in the setup function of the extension). |
infoSize | Size of extension info for allocate memory (use sizeof(ExtensionInfoStruct)). |
API TelError telExtensionUnload | ( | TelExtension * | self, |
const char *restrict | cleanupFunctionName ) |
Function that unload the extension.
The function unloads the extension frees the associated memory and calls the cleanup function, which is used to clean the allocated memory by the extension itself.
self | Extension over which actions are performed. |
cleanupInfo | Pointer that is the second argument to "setupFunction" |
cleanupFunctionName | Name of cleanup function in the extension (requires the information parameter in the cleanup function of the extension). |