-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsdk.cpp
More file actions
24 lines (19 loc) · 688 Bytes
/
Copy pathsdk.cpp
File metadata and controls
24 lines (19 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "sdk.hpp"
#include "string.h"
InterfaceReg* InterfaceReg::s_pInterfaceRegs = nullptr;
static void* CreateInterfaceInternal(const char* pName, int* pReturnCode) {
InterfaceReg* pCur;
for(pCur = InterfaceReg::s_pInterfaceRegs; pCur; pCur = pCur->m_pNext) {
if(!strcmp(pCur->m_pName, pName)) {
if(pReturnCode) *pReturnCode = 0;
return pCur->m_CreateFn();
}
}
if(pReturnCode) *pReturnCode = 1;
return nullptr;
}
// exported function expected to be located inside a plugin
// it allows for getting the required interface by it's version
extern "C" void* CreateInterface(const char* pName, int* pReturnCode) {
return CreateInterfaceInternal(pName, pReturnCode);
}