included 'libltdl' source, so that we can build cross-platform
[freeradius.git] / libltdl / ltdl.h
1 /* ltdl.h -- generic dlopen functions
2    Copyright (C) 1998-1999 Free Software Foundation, Inc.
3    Originally by Thomas Tanner <tanner@ffii.org>
4    This file is part of GNU Libtool.
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 As a special exception to the GNU Library General Public License,
12 if you distribute this file as part of a program that uses GNU libtool
13 to create libraries and programs, you may include it under the same
14 distribution terms that you use for the rest of that program.
15
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 Library General Public License for more details.
20
21 You should have received a copy of the GNU Library General Public
22 License along with this library; if not, write to the Free
23 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
24 02111-1307  USA
25 */
26
27 /* Only include this header file once. */
28 #ifndef _LTDL_H_
29 #define _LTDL_H_ 1
30
31 /* __BEGIN_DECLS should be used at the beginning of your declarations,
32    so that C++ compilers don't mangle their names.  Use __END_DECLS at
33    the end of C declarations. */
34 #undef __BEGIN_DECLS
35 #undef __END_DECLS
36 #ifdef __cplusplus
37 # define __BEGIN_DECLS extern "C" {
38 # define __END_DECLS }
39 #else
40 # define __BEGIN_DECLS /* empty */
41 # define __END_DECLS /* empty */
42 #endif
43
44 /* LTDL_PARAMS is a macro used to wrap function prototypes, so that compilers
45    that don't understand ANSI C prototypes still work, and ANSI C
46    compilers can issue warnings about type mismatches. */
47 #undef LTDL_PARAMS
48 #undef lt_ptr_t
49 #if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
50 # define LTDL_PARAMS(protos)    protos
51 # define lt_ptr_t       void*
52 #else
53 # define LTDL_PARAMS(protos)    ()
54 # define lt_ptr_t       char*
55 #endif
56
57 #include <stdlib.h>
58
59 #ifdef _LTDL_COMPILE_
60 typedef struct lt_dlhandle_t *lt_dlhandle;
61 #else
62 typedef lt_ptr_t lt_dlhandle;
63 #endif
64
65 typedef struct {
66         const char *name;
67         lt_ptr_t address;
68 } lt_dlsymlist;
69
70 __BEGIN_DECLS
71 extern int lt_dlinit LTDL_PARAMS((void));
72 extern int lt_dlpreload LTDL_PARAMS((const lt_dlsymlist *preloaded));
73 extern int lt_dlpreload_default LTDL_PARAMS((const lt_dlsymlist *preloaded));
74 extern int lt_dlexit LTDL_PARAMS((void));
75 extern lt_dlhandle lt_dlopen LTDL_PARAMS((const char *filename));
76 extern lt_dlhandle lt_dlopenext LTDL_PARAMS((const char *filename));
77 extern int lt_dlclose LTDL_PARAMS((lt_dlhandle handle));
78 extern lt_ptr_t lt_dlsym LTDL_PARAMS((lt_dlhandle handle, const char *name));
79 extern const char *lt_dlerror LTDL_PARAMS((void));
80 extern int lt_dladdsearchdir LTDL_PARAMS((const char *search_dir));
81 extern int lt_dlsetsearchpath LTDL_PARAMS((const char *search_path));
82 extern const char *lt_dlgetsearchpath LTDL_PARAMS((void));
83
84 extern const lt_dlsymlist lt_preloaded_symbols[];
85 #define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols)
86
87 extern lt_ptr_t (*lt_dlmalloc)LTDL_PARAMS((size_t size));
88 extern void (*lt_dlfree)LTDL_PARAMS((lt_ptr_t ptr));
89
90 __END_DECLS
91
92 #endif /* !_LTDL_H_ */