libg722_1 0.1.0
lt_dlloader.h
1/* lt_dlloader.h -- dynamic library loader interface
2
3 Copyright (C) 2004, 2007-2008, 2011-2019, 2021-2024 Free Software
4 Foundation, Inc.
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
10GNU Libltdl is free software; you can redistribute it and/or
11modify it under the terms of the GNU Lesser General Public
12License as published by the Free Software Foundation; either
13version 2 of the License, or (at your option) any later version.
14
15As a special exception to the GNU Lesser General Public License,
16if you distribute this file as part of a program or library that
17is built using GNU Libtool, you may include this file under the
18same distribution terms that you use for the rest of that program.
19
20GNU Libltdl is distributed in the hope that it will be useful,
21but WITHOUT ANY WARRANTY; without even the implied warranty of
22MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23GNU Lesser General Public License for more details.
24
25You should have received a copy of the GNU Lesser General Public
26License along with GNU Libltdl. If not, see <https://www.gnu.org/licenses/>.
27*/
28
29#if !defined LT_DLLOADER_H
30#define LT_DLLOADER_H 1
31
32#include <libltdl/lt_system.h>
33
34LT_BEGIN_C_DECLS
35
36typedef void * lt_dlloader;
37typedef void * lt_module;
38typedef void * lt_user_data;
39typedef struct lt__advise * lt_dladvise;
40
41/* Function pointer types for module loader vtable entries: */
42typedef lt_module lt_module_open (lt_user_data data,
43 const char *filename,
44 lt_dladvise advise);
45typedef int lt_module_close (lt_user_data data,
46 lt_module module);
47typedef void * lt_find_sym (lt_user_data data, lt_module module,
48 const char *symbolname);
49typedef int lt_dlloader_init (lt_user_data data);
50typedef int lt_dlloader_exit (lt_user_data data);
51
52/* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */
53typedef 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. */
59typedef 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;
70
71LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable);
72LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader);
73
74LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name);
75LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name);
76LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader);
77
78
79/* Type of a function to get a loader's vtable: */
80typedef const lt_dlvtable *lt_get_vtable (lt_user_data data);
81
82#ifdef LT_DEBUG_LOADERS
83LT_SCOPE void lt_dlloader_dump (void);
84#endif
85
86LT_END_C_DECLS
87
88#endif /*!defined LT_DLLOADER_H*/
Definition lt__private.h:120
Definition lt_dlloader.h:59