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 #if !defined(LT_DLLOADER_H)
32 #define LT_DLLOADER_H 1
33
34 #include <libltdl/lt_system.h>
35
36 LT_BEGIN_C_DECLS
37
38 typedef void * lt_dlloader;
39 typedef void * lt_module;
40 typedef void * lt_user_data;
41 typedef struct lt__advise * lt_dladvise;
42
43
44 typedef lt_module lt_module_open (lt_user_data data,
45 const char *filename,
46 lt_dladvise advise);
47 typedef int lt_module_close (lt_user_data data,
48 lt_module module);
49 typedef void * lt_find_sym (lt_user_data data, lt_module module,
50 const char *symbolname);
51 typedef int lt_dlloader_init (lt_user_data data);
52 typedef int lt_dlloader_exit (lt_user_data data);
53
54
55 typedef enum {
56 LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND
57 } lt_dlloader_priority;
58
59
60
61 typedef struct {
62 const char * name;
63 const char * sym_prefix;
64 lt_module_open * module_open;
65 lt_module_close * module_close;
66 lt_find_sym * find_sym;
67 lt_dlloader_init * dlloader_init;
68 lt_dlloader_exit * dlloader_exit;
69 lt_user_data dlloader_data;
70 lt_dlloader_priority priority;
71 } lt_dlvtable;
72
73 LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable);
74 LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader);
75
76 LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name);
77 LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name);
78 LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader);
79
80
81
82 typedef const lt_dlvtable *lt_get_vtable (lt_user_data data);
83
84 #ifdef LT_DEBUG_LOADERS
85 LT_SCOPE void lt_dlloader_dump (void);
86 #endif
87
88 LT_END_C_DECLS
89
90 #endif