TEL
Create your extensible application
Loading...
Searching...
No Matches
Extension.h
Go to the documentation of this file.
1/*
2 * Use MIT License
3 * Copyright (c) 2025 semenovihandrei
4 */
5
16
17#ifndef TEL_EXTENSION_H
18#define TEL_EXTENSION_H
19
20#include <APIMacros/api.h>
21#include <stddef.h>
22#include <stdlib.h>
23
27typedef struct {
28 unsigned char code;
29 void* ret;
30} TelError;
31
32#define TEL_ERROR_NO 0
33#define TEL_ERROR_GET_FUNC 1
34#define TEL_ERROR_EXT_LOAD 2
35
39typedef struct {
40 void* info;
43 void* library;
45
59#define TEL_NEW_EXTENSION(extension, struct) \
60 TelExtension* extension = (TelExtension*)malloc(sizeof(TelExtension)); \
61 extension->info = (struct*)malloc(sizeof(struct))
62
82API TelError telExtensionLoad(TelExtension* self, const char* restrict path,
83 const char* restrict setupFunctionName);
84
103 const char* restrict cleanupFunctionName);
104
105#endif // !TEL_EXTENSION_H
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.
The structure that represents the error on return.
Definition Extension.h:27
unsigned char code
Definition Extension.h:28
void * ret
Definition Extension.h:29
The structure that represents the extension.
Definition Extension.h:39
void * library
Definition Extension.h:43
void * info
Definition Extension.h:40