File: boot.c

package info (click to toggle)
qbble 1.2-10
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 108 kB
  • ctags: 143
  • sloc: cpp: 735; ansic: 138; makefile: 50
file content (30 lines) | stat: -rw-r--r-- 470 bytes parent folder | download | duplicates (3)
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
#include <dlfcn.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
	// just copied it all from the dlopen man page
	void * handle;
	void (*init)(void);
	char * error;
	
	handle = dlopen("/usr/lib/xmms/General/libqbble.so", RTLD_LAZY);
	if (!handle)
	{
		fputs(dlerror(), stderr);
		exit(1);
	}

	init = dlsym(handle, "init");
	if ((error = dlerror()) != NULL)
	{
		fputs(error, stderr);
		exit(1);
	}
	(*init)();
	dlclose(handle);

	return 0;
}