work on implementing xtool
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "tier1/interface.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier1/utlstring.h"
|
||||
#include "dlfcn.h"
|
||||
|
||||
static CInterfaceRegistry *s_pInterfaceRegistries;
|
||||
@@ -12,7 +13,7 @@ CInterfaceRegistry::CInterfaceRegistry( InstantiateInterfaceFn fn, const char *s
|
||||
s_pInterfaceRegistries = this;
|
||||
Dl_info info = {};
|
||||
dladdr((void *)&s_pInterfaceRegistries, &info);
|
||||
printf("%p: %s in %s\n",&s_pInterfaceRegistries, m_szName, info.dli_fname);
|
||||
//printf("%p: %s in %s\n",&s_pInterfaceRegistries, m_szName, info.dli_fname);
|
||||
};
|
||||
|
||||
DLL_EXPORT void *CreateInterface( const char *szName, int *pReturnCode )
|
||||
@@ -37,3 +38,13 @@ CreateInterfaceFn Sys_GetFactory( void *lib )
|
||||
{
|
||||
return (CreateInterfaceFn)Plat_GetProc(lib, "CreateInterface");
|
||||
}
|
||||
CreateInterfaceFn Sys_GetFactory( const char *szLibrary )
|
||||
{
|
||||
void *pLib = NULL;
|
||||
CUtlString szLib = szLibrary;
|
||||
#if defined(__linux)
|
||||
szLib = CUtlString("lib%s.so", szLib.GetFileName().GetString());
|
||||
pLib = Plat_LoadLibrary(szLib);
|
||||
#endif
|
||||
return Sys_GetFactory(pLib);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user