]> git.ipfire.org Git - thirdparty/gcc.git/blame - libjava/libltdl/ltdl.h
Initial revision
[thirdparty/gcc.git] / libjava / libltdl / ltdl.h
CommitLineData
06f56737
TT
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
6This library is free software; you can redistribute it and/or
7modify it under the terms of the GNU Library General Public
8License as published by the Free Software Foundation; either
9version 2 of the License, or (at your option) any later version.
10
11As a special exception to the GNU Library General Public License,
12if you distribute this file as part of a program that uses GNU libtool
13to create libraries and programs, you may include it under the same
14distribution terms that you use for the rest of that program.
15
16This library is distributed in the hope that it will be useful,
17but WITHOUT ANY WARRANTY; without even the implied warranty of
18MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19Library General Public License for more details.
20
21You should have received a copy of the GNU Library General Public
22License along with this library; if not, write to the Free
23Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
2402111-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_
60typedef struct lt_dlhandle_t *lt_dlhandle;
61#else
62typedef lt_ptr_t lt_dlhandle;
63#endif
64
65typedef struct {
66 const char *name;
67 lt_ptr_t address;
68} lt_dlsymlist;
69
70__BEGIN_DECLS
71extern int lt_dlinit LTDL_PARAMS((void));
72extern int lt_dlpreload LTDL_PARAMS((const lt_dlsymlist *preloaded));
73extern int lt_dlpreload_default LTDL_PARAMS((const lt_dlsymlist *preloaded));
74extern int lt_dlexit LTDL_PARAMS((void));
75extern lt_dlhandle lt_dlopen LTDL_PARAMS((const char *filename));
76extern lt_dlhandle lt_dlopenext LTDL_PARAMS((const char *filename));
77extern int lt_dlclose LTDL_PARAMS((lt_dlhandle handle));
78extern lt_ptr_t lt_dlsym LTDL_PARAMS((lt_dlhandle handle, const char *name));
79extern const char *lt_dlerror LTDL_PARAMS((void));
80extern int lt_dladdsearchdir LTDL_PARAMS((const char *search_dir));
81extern int lt_dlsetsearchpath LTDL_PARAMS((const char *search_path));
82extern const char *lt_dlgetsearchpath LTDL_PARAMS((void));
83
84extern const lt_dlsymlist lt_preloaded_symbols[];
85#define LTDL_SET_PRELOADED_SYMBOLS() lt_dlpreload_default(lt_preloaded_symbols)
86
87extern lt_ptr_t (*lt_dlmalloc)LTDL_PARAMS((size_t size));
88extern void (*lt_dlfree)LTDL_PARAMS((lt_ptr_t ptr));
89
90__END_DECLS
91
92#endif /* !_LTDL_H_ */