WebFramework v3.0.12
Web framework for C++.
Loading...
Searching...
No Matches
web_framework_c_api.h
1#pragma once
2
3#ifdef WEB_FRAMEWORK_DLL
4
5#include <stdint.h>
6
7#ifdef __LINUX__
8#define EXPORT extern "C" __attribute__((visibility("default")))
9#else
10#define EXPORT extern "C" __declspec(dllexport)
11#endif
12
13typedef void* String;
14typedef void* Config;
15typedef void* WebFramework;
16typedef void* Exception;
17
18EXPORT void deleteWebFrameworkString(String string);
19
20EXPORT void deleteWebFrameworkConfig(Config config);
21
22EXPORT void deleteWebFramework(WebFramework webFramework);
23
24EXPORT void deleteWebFrameworkException(Exception exception);
25
26EXPORT const char* getDataFromString(String string);
27
29
30EXPORT WebFramework createWebFrameworkFromPath(const char* configPath, Exception* exception);
31
32EXPORT WebFramework createWebFrameworkFromString(const char* serverConfiguration, const char* applicationDirectory, Exception* exception);
33
34EXPORT WebFramework createWebFrameworkFromConfig(Config config, Exception* exception);
35
36EXPORT Config createConfigFromPath(const char* configPath, Exception* exception);
37
38EXPORT Config createConfigFromString(const char* serverConfiguration, const char* applicationDirectory, Exception* exception);
39
41
42EXPORT void startWebFrameworkServerCXX(WebFramework server, bool wait, void* onStartServer, Exception* exception);
43
44EXPORT void startWebFrameworkServer(WebFramework server, bool wait, void (*onStartServer)(), Exception* exception);
45
46EXPORT void stopWebFrameworkServer(WebFramework server, bool wait, Exception* exception);
47
48EXPORT bool isServerRunning(WebFramework server, Exception* exception);
49
50EXPORT const char* getWebFrameworkVersion();
51
52EXPORT void overrideConfigurationString(Config config, const char* key, const char* value, bool recursive, Exception* exception);
53
54EXPORT void overrideConfigurationInteger(Config config, const char* key, int64_t value, bool recursive, Exception* exception);
55
56EXPORT void overrideConfigurationBoolean(Config config, const char* key, bool value, bool recursive, Exception* exception);
57
58EXPORT void overrideConfigurationStringArray(Config config, const char* key, const char** value, bool recursive, int64_t size, Exception* exception);
59
60EXPORT void overrideConfigurationIntegerArray(Config config, const char* key, const int64_t* value, bool recursive, int64_t size, Exception* exception);
61
62EXPORT void overrideBasePath(Config config, const char* basePath, Exception* exception);
63
64EXPORT String getConfigurationString(Config config, const char* key, bool recursive, Exception* exception);
65
66EXPORT int64_t getConfigurationInteger(Config config, const char* key, bool recursive, Exception* exception);
67
68EXPORT bool getConfigurationBoolean(Config config, const char* key, bool recursive, Exception* exception);
69
70EXPORT void* getConfiguration(Config config, Exception* exception);
71
72EXPORT const char* getRawConfiguration(Config config, Exception* exception);
73
74EXPORT void* getBasePath(Config config, Exception* exception);
75
77
78EXPORT const char* getErrorMessage(Exception exception);
79
80#endif