summaryrefslogtreecommitdiff
path: root/wrappers/dlfcn/dlfake.c
blob: d347bf024bea2ffde92832f771a4ee7756da730d (plain)
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
#include "dlfake.h"
#include "linkage/inittab.h"

extern struct _inittab _PyImport_Inittab[];

void * dlfake_dlopen(const char * name, int mode)
{
	struct _inittab * pyext;

	if (!name)
		return _PyImport_Inittab;

	for (pyext=_PyImport_Inittab; pyext->name; pyext++)
		if (!strcmp(name,pyext->name))
			return _PyImport_Inittab;

	return 0;
}

int dlfake_dlclose(void * handle)
{
	return -1;
}

void * dlfake_dlsym(void * handle, const char * sym)
{
	return 0;
}

static const char dlfake_errstr[] =
	"dlfake_dlerror(): "
	"not implemented";

char * dlfake_dlerror(void)
{
	return (char *)dlfake_errstr;
}

int dlfake_dladdr(const void * addr, void * info)
{
	return 0;
}