-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDekiHttpModule.cpp
More file actions
57 lines (48 loc) · 1.73 KB
/
Copy pathDekiHttpModule.cpp
File metadata and controls
57 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "DekiHttpModule.h"
#include "interop/DekiPlugin.h"
#include "DekiLogSystem.h"
#include "DekiHttp.h"
#ifdef DEKI_EDITOR
extern void DekiHttp_RegisterComponents();
extern int DekiHttp_GetAutoComponentCount();
extern const DekiComponentMeta* DekiHttp_GetAutoComponentMeta(int index);
static bool s_HttpRegistered = false;
extern "C" {
DEKI_HTTP_API int DekiHttp_EnsureRegistered(void)
{
if (s_HttpRegistered)
return DekiHttp_GetAutoComponentCount();
s_HttpRegistered = true;
DekiHttp_RegisterComponents();
return DekiHttp_GetAutoComponentCount();
}
DEKI_PLUGIN_API const char* DekiPlugin_GetName(void) { return "Deki HTTP Module"; }
DEKI_PLUGIN_API const char* DekiPlugin_GetVersion(void)
{
#ifdef DEKI_MODULE_VERSION
return DEKI_MODULE_VERSION;
#else
return "0.0.0-dev";
#endif
}
DEKI_PLUGIN_API const char* DekiPlugin_GetReflectionJson(void) { return "{}"; }
DEKI_PLUGIN_API int DekiPlugin_Init(void) { DEKI_LOG_INFO("[deki-http] DekiPlugin_Init"); return 0; }
DEKI_PLUGIN_API void DekiPlugin_Shutdown(void)
{
s_HttpRegistered = false;
DekiHttp::SetCurrent(nullptr);
}
DEKI_PLUGIN_API int DekiPlugin_GetComponentCount(void){ return DekiHttp_GetAutoComponentCount(); }
DEKI_PLUGIN_API const DekiComponentMeta* DekiPlugin_GetComponentMeta(int index)
{
return DekiHttp_GetAutoComponentMeta(index);
}
DEKI_PLUGIN_API void DekiPlugin_RegisterComponents(void)
{
int n = DekiHttp_EnsureRegistered();
DEKI_LOG_INFO("[deki-http] DekiPlugin_RegisterComponents -> %d component(s)", n);
}
DEKI_PLUGIN_API int DekiPlugin_GetFeatureCount(void) { return 0; }
DEKI_PLUGIN_API const struct DekiModuleFeatureInfo* DekiPlugin_GetFeature(int) { return nullptr; }
} // extern "C"
#endif // DEKI_EDITOR