Annotation of parser3/src/lib/ltdl/libltdl/lt_dlloader.h, revision 1.2
1.1 moko 1: /* lt_dlloader.h -- dynamic library loader interface
2:
1.2 ! moko 3: Copyright (C) 2004, 2007-2008, 2011-2019, 2021-2024 Free Software
! 4: Foundation, Inc.
1.1 moko 5: Written by Gary V. Vaughan, 2004
6:
7: NOTE: The canonical source of this file is maintained with the
8: GNU Libtool package. Report bugs to bug-libtool@gnu.org.
9:
10: GNU Libltdl is free software; you can redistribute it and/or
11: modify it under the terms of the GNU Lesser General Public
12: License as published by the Free Software Foundation; either
13: version 2 of the License, or (at your option) any later version.
14:
15: As a special exception to the GNU Lesser General Public License,
16: if you distribute this file as part of a program or library that
17: is built using GNU Libtool, you may include this file under the
18: same distribution terms that you use for the rest of that program.
19:
20: GNU Libltdl is distributed in the hope that it will be useful,
21: but WITHOUT ANY WARRANTY; without even the implied warranty of
22: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23: GNU Lesser General Public License for more details.
24:
25: You should have received a copy of the GNU Lesser General Public
1.2 ! moko 26: License along with GNU Libltdl. If not, see <https://www.gnu.org/licenses/>.
1.1 moko 27: */
28:
1.2 ! moko 29: #if !defined LT_DLLOADER_H
1.1 moko 30: #define LT_DLLOADER_H 1
31:
32: #include <libltdl/lt_system.h>
33:
34: LT_BEGIN_C_DECLS
35:
36: typedef void * lt_dlloader;
37: typedef void * lt_module;
38: typedef void * lt_user_data;
39: typedef struct lt__advise * lt_dladvise;
40:
41: /* Function pointer types for module loader vtable entries: */
42: typedef lt_module lt_module_open (lt_user_data data,
43: const char *filename,
44: lt_dladvise advise);
45: typedef int lt_module_close (lt_user_data data,
46: lt_module module);
47: typedef void * lt_find_sym (lt_user_data data, lt_module module,
48: const char *symbolname);
49: typedef int lt_dlloader_init (lt_user_data data);
50: typedef int lt_dlloader_exit (lt_user_data data);
51:
52: /* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */
53: typedef enum {
54: LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND
55: } lt_dlloader_priority;
56:
57: /* This structure defines a module loader, as populated by the get_vtable
58: entry point of each loader. */
59: typedef struct {
60: const char * name;
61: const char * sym_prefix;
62: lt_module_open * module_open;
63: lt_module_close * module_close;
64: lt_find_sym * find_sym;
65: lt_dlloader_init * dlloader_init;
66: lt_dlloader_exit * dlloader_exit;
67: lt_user_data dlloader_data;
68: lt_dlloader_priority priority;
69: } lt_dlvtable;
70:
71: LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable);
72: LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader);
73:
74: LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name);
75: LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name);
76: LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader);
77:
78:
79: /* Type of a function to get a loader's vtable: */
80: typedef const lt_dlvtable *lt_get_vtable (lt_user_data data);
81:
82: #ifdef LT_DEBUG_LOADERS
83: LT_SCOPE void lt_dlloader_dump (void);
84: #endif
85:
86: LT_END_C_DECLS
87:
1.2 ! moko 88: #endif /*!defined LT_DLLOADER_H*/
E-mail: