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