added forgotten files
This commit is contained in:
@@ -1,18 +1,23 @@
|
||||
#include "tier1/interface.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "dlfcn.h"
|
||||
|
||||
static CInterfaceRegistry *s_pInterfaceRegistries;
|
||||
|
||||
CInterfaceRegistry *g_pInterfaceRegistries = NULL;
|
||||
CInterfaceRegistry::CInterfaceRegistry( InstantiateInterfaceFn fn, const char *szName )
|
||||
: m_szName(szName)
|
||||
{
|
||||
m_CreateFn = fn;
|
||||
m_pNext = g_pInterfaceRegistries;
|
||||
g_pInterfaceRegistries = this;
|
||||
m_pNext = s_pInterfaceRegistries;
|
||||
s_pInterfaceRegistries = this;
|
||||
Dl_info info = {};
|
||||
dladdr((void *)&s_pInterfaceRegistries, &info);
|
||||
printf("%p: %s in %s\n",&s_pInterfaceRegistries, m_szName, info.dli_fname);
|
||||
};
|
||||
|
||||
void *CreateInterface( const char *szName, int *pReturnCode )
|
||||
DLL_EXPORT void *CreateInterface( const char *szName, int *pReturnCode )
|
||||
{
|
||||
CInterfaceRegistry *pRegistry = g_pInterfaceRegistries;
|
||||
CInterfaceRegistry *pRegistry = s_pInterfaceRegistries;
|
||||
while (pRegistry)
|
||||
{
|
||||
if (!V_strcmp(szName, pRegistry->m_szName))
|
||||
@@ -30,5 +35,8 @@ void *CreateInterface( const char *szName, int *pReturnCode )
|
||||
|
||||
CreateInterfaceFn Sys_GetFactory( void *lib )
|
||||
{
|
||||
#ifdef POSIX
|
||||
return CreateInterface;
|
||||
#endif
|
||||
return (CreateInterfaceFn)Plat_GetProc(lib, "CreateInterface");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user