88 lines
1.4 KiB
C
88 lines
1.4 KiB
C
#include "platform/platform.h"
|
|
#if XASH_LIB == LIB_STATIC
|
|
|
|
|
|
#ifdef XASH_NO_LIBDL
|
|
|
|
void *dlsym(void *handle, const char *symbol )
|
|
{
|
|
Con_DPrintf( "dlsym( %p, \"%s\" ): stub\n", handle, symbol );
|
|
return NULL;
|
|
}
|
|
|
|
void *dlopen(const char *name, int flag )
|
|
{
|
|
Con_DPrintf( "dlopen( \"%s\", %d ): stub\n", name, flag );
|
|
return NULL;
|
|
}
|
|
|
|
int dlclose(void *handle)
|
|
{
|
|
Con_DPrintf( "dlsym( %p ): stub\n", handle );
|
|
return 0;
|
|
}
|
|
|
|
char *dlerror( void )
|
|
{
|
|
return "Loading ELF libraries not supported in this build!\n";
|
|
}
|
|
|
|
int dladdr( const void *addr, void *info )
|
|
{
|
|
return 0;
|
|
}
|
|
#endif // XASH_NO_LIBDL
|
|
|
|
|
|
typedef struct table_s
|
|
{
|
|
const char *name;
|
|
void *pointer;
|
|
} table_t;
|
|
|
|
|
|
#include "generated_library_tables.h"
|
|
|
|
|
|
static void *Lib_Find(table_t *tbl, const char *name )
|
|
{
|
|
while( tbl->name )
|
|
{
|
|
if( !Q_strcmp( tbl->name, name) )
|
|
return tbl->pointer;
|
|
tbl++;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean directpath )
|
|
{
|
|
return Lib_Find(libs, dllname);
|
|
}
|
|
|
|
void COM_FreeLibrary( void *hInstance )
|
|
{
|
|
// impossible
|
|
}
|
|
|
|
void *COM_GetProcAddress( void *hInstance, const char *name )
|
|
{
|
|
return Lib_Find( hInstance, name );
|
|
}
|
|
|
|
void *COM_FunctionFromName( void *hInstance, const char *pName )
|
|
{
|
|
return Lib_Find( hInstance, pName );
|
|
}
|
|
|
|
|
|
const char *COM_NameForFunction( void *hInstance, void *function )
|
|
{
|
|
#ifdef XASH_ALLOW_SAVERESTORE_OFFSETS
|
|
return COM_OffsetNameForFunction( function );
|
|
#else
|
|
return NULL;
|
|
#endif
|
|
}
|
|
#endif
|