Annotation of parser3/src/lib/ltdl/libltdl/lt__private.h, revision 1.2
1.1 moko 1: /* lt__private.h -- internal apis for libltdl
2:
1.2 ! moko 3: Copyright (C) 2004-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: This library 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__PRIVATE_H
1.1 moko 30: #define LT__PRIVATE_H 1
31:
1.2 ! moko 32: #if defined LT_CONFIG_H
1.1 moko 33: # include LT_CONFIG_H
34: #else
35: # include <config.h>
36: #endif
37:
38: #include <stdio.h>
39: #include <ctype.h>
40: #include <assert.h>
41: #include <errno.h>
42: #include <string.h>
43:
1.2 ! moko 44: #if defined HAVE_UNISTD_H
1.1 moko 45: # include <unistd.h>
46: #endif
47:
48: /* Import internal interfaces... */
49: #include "lt__alloc.h"
50: #include "lt__dirent.h"
51: #include "lt__strl.h"
52: #include "lt__glibc.h"
53:
54: /* ...and all exported interfaces. */
55: #include "ltdl.h"
56:
1.2 ! moko 57: #if defined WITH_DMALLOC
1.1 moko 58: # include <dmalloc.h>
59: #endif
60:
61: /* DLL building support on win32 hosts; mostly to workaround their
62: ridiculous implementation of data symbol exporting. */
63: #ifndef LT_GLOBAL_DATA
1.2 ! moko 64: # if defined __WINDOWS__ || defined __CYGWIN__
! 65: # if defined DLL_EXPORT /* defined by libtool (if required) */
1.1 moko 66: # define LT_GLOBAL_DATA __declspec(dllexport)
67: # endif
68: # endif
69: # ifndef LT_GLOBAL_DATA
70: # define LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */
71: # endif
72: #endif
73:
74: #ifndef __attribute__
75: # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
76: # define __attribute__(x)
77: # endif
78: #endif
79:
80: #ifndef LT__UNUSED
81: # define LT__UNUSED __attribute__ ((__unused__))
82: #endif
83:
84:
85: LT_BEGIN_C_DECLS
86:
1.2 ! moko 87: #if !defined errno
1.1 moko 88: extern int errno;
89: #endif
90:
91: LT_SCOPE void lt__alloc_die_callback (void);
92:
93:
94: /* For readability: */
1.2 ! moko 95: #define STRNEQ(s1, s2) (strcmp((s1), (s2)) != 0)
! 96: #define STREQ(s1, s2) (strcmp((s1), (s2)) == 0)
1.1 moko 97:
98:
99:
100: /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */
101:
102: /* This type is used for the array of interface data sets in each handler. */
103: typedef struct {
104: lt_dlinterface_id key;
105: void * data;
106: } lt_interface_data;
107:
108: struct lt__handle {
109: lt_dlhandle next;
110: const lt_dlvtable * vtable; /* dlopening interface */
111: lt_dlinfo info; /* user visible fields */
112: int depcount; /* number of dependencies */
113: lt_dlhandle * deplibs; /* dependencies */
114: lt_module module; /* system module handle */
115: void * system; /* system specific data */
116: lt_interface_data * interface_data; /* per caller associated data */
117: int flags; /* various boolean stats */
118: };
119:
120: struct lt__advise {
121: unsigned int try_ext:1; /* try system library extensions. */
122: unsigned int is_resident:1; /* module can't be unloaded. */
123: unsigned int is_symglobal:1; /* module symbols can satisfy
124: subsequently loaded modules. */
125: unsigned int is_symlocal:1; /* module symbols are only available
126: locally. */
127: unsigned int try_preload_only:1;/* only preloaded modules will be tried. */
128: };
129:
130: /* --- ERROR HANDLING --- */
131:
132: /* Extract the diagnostic strings from the error table macro in the same
133: order as the enumerated indices in lt_error.h. */
134:
135: #define LT__STRERROR(name) lt__error_string(LT_CONC(LT_ERROR_,name))
136:
137: #define LT__GETERROR(lvalue) (lvalue) = lt__get_last_error()
138: #define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg)
139: #define LT__SETERROR(errorcode) LT__SETERRORSTR(LT__STRERROR(errorcode))
140:
141: LT_SCOPE const char *lt__error_string (int errorcode);
142: LT_SCOPE const char *lt__get_last_error (void);
143: LT_SCOPE const char *lt__set_last_error (const char *errormsg);
144:
145: LT_END_C_DECLS
146:
1.2 ! moko 147: #endif /*!defined LT__PRIVATE_H*/
E-mail: