blob: 79354912876dce7c78417e859fc2ef4327bd9c7f (
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
|
#include <stdio.h>
#include "plugin.h"
#ifdef RCC_PLUGINS
# include <dlfcn.h>
# ifndef RTLD_NOW
# define RTLD_NOW 0
# endif
#endif /* RCC_PLUGINS */
rcc_library_handle rccLibraryOpen(char *filename)
{
#ifdef RCC_PLUGINS
return (rcc_library_handle)dlopen(filename, RTLD_NOW);
#else
return NULL;
#endif /* RCC_PLUGINS */
}
void rccLibraryClose(rcc_library_handle handle)
{
#ifdef RCC_PLUGINS
puts("HHHHHHHHHHHHHHHHHHHH");
dlclose(handle);
#endif /* RCC_PLUGINS */
}
void* rccLibraryFind(rcc_library_handle handle, const char *symbol)
{
#ifdef RCC_PLUGINS
return dlsym(handle, symbol);
#else
return NULL;
#endif /* RCC_PLUGINS */
}
|