libtool/libltdl/ltdl.h
Alexandre Oliva 07978fe161 * ltmain.in (-force-static, force_static): removed
* libltdl/Makefile.am (CFLAGS): ditto
	* libltdl/configure.in: check for memory.h, rindex() and
	dlpreopening.  Fixed NEED_USCORE caching policy.
	* libltdl/ltdl.h (lt_dlsym): make the name argument const
	* libltdl/ltdl.c (types): new variable: head of list of available
	dlopening mechanisms
	(lt_dltype_t): interface of a dlopening mechanism, with pointers
	to functions for init, exit, open, close and sym
	(lt_dlhandle_t): added pointer to interface type
	(strdup): don't name it strdup; it can be troublesome
	(strrchr): ditto; use rindex if available
	(LIBTOOL_STATIC): check HAVE_DLPREOPEN instead, and move to the
	end of the file, so that it becomes the header of the list
	(all): renamed all interface-implementation functions, to avoid
	name clashes, and created lt_dltype_t nodes for all of them
	(lt_dlinit): initialize all available interfaces; remove those
	that fail from the list.  Return failure only if no interfaces
	could be initialized.
	(lt_dlexit): return number of failures
	(tryall_dlopen): try to open the library with all available
	interfaces
	(lt_dlopen): use tryall_dlopen; increased size of fixed buffers.
	We should probably make these bound-checked or dynamically
	allocated for the final release!  Fix bug when filename did not
	contain slashes; should we check for `\\' too?  Try old_library if
	everything else fails.
	(lt_dlclose): use the interface type for closing
	(lt_dlsym): make `symbol' const, use interface type for looking up
	* mdemo/Makefile.am: moved mdemo/modules/* back into mdemo
	(SUBDIRS): removed
	(libfoo2_la_LDFLAGS): added -static; nice test.  However, since it
	causes -lm to linked into hell*, it causes tests that should fail
	to pass
	(noinst_HEADERS): no need to install foo.h
	* mdemo/configure.in: remove modules/Makefile
	tests/mdemo-exec.test: updated accordingly
1998-12-16 05:42:23 +00:00

65 lines
2.1 KiB
C

/* ltdl.h -- generic dlopen functions
Copyright (C) 1998 Thomas Tanner <tanner@gmx.de>
This file is part of GNU Libtool.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Only include this header file once. */
#ifndef _LTDL_H_
#define _LTDL_H_ 1
/* __BEGIN_DECLS should be used at the beginning of your declarations,
so that C++ compilers don't mangle their names. Use __END_DECLS at
the end of C declarations. */
#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
/* __P is a macro used to wrap function prototypes, so that compilers
that don't understand ANSI C prototypes still work, and ANSI C
compilers can issue warnings about type mismatches. */
#undef __P
#undef __ptr_t
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
# define __P(protos) protos
# define __ptr_t void*
#else
# define __P(protos) ()
# define __ptr_t char*
#endif
#ifdef _LTDL_COMPILE_
typedef struct lt_dlhandle_t *lt_dlhandle;
#else
typedef __ptr_t lt_dlhandle;
#endif
__BEGIN_DECLS
int lt_dlinit __P((void));
int lt_dlexit __P((void));
lt_dlhandle lt_dlopen __P((const char *filename));
int lt_dlclose __P((lt_dlhandle handle));
__ptr_t lt_dlsym __P((lt_dlhandle handle, const char *name));
__END_DECLS
#endif /* !_LTDL_H_ */