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.
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.
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.
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.
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
27 /* Only include this header file once. */
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. */
37 # define __BEGIN_DECLS extern "C" {
38 # define __END_DECLS }
40 # define __BEGIN_DECLS /* empty */
41 # define __END_DECLS /* empty */
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. */
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*
53 # define LTDL_PARAMS(protos) ()
54 # define lt_ptr_t char*
60 typedef struct lt_dlhandle_t
*lt_dlhandle
;
62 typedef lt_ptr_t lt_dlhandle
;
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));
84 extern const lt_dlsymlist lt_preloaded_symbols
[];
85 #define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols)
87 extern lt_ptr_t (*lt_dlmalloc
)LTDL_PARAMS((size_t size
));
88 extern void (*lt_dlfree
)LTDL_PARAMS((lt_ptr_t ptr
));
92 #endif /* !_LTDL_H_ */