dlfcn.h revision 50473
1174195Srwatson/* 2174195Srwatson * Copyright (c) 1994 3174195Srwatson * The Regents of the University of California. All rights reserved. 4174195Srwatson * 5174195Srwatson * Redistribution and use in source and binary forms, with or without 6174195Srwatson * modification, are permitted provided that the following conditions 7174195Srwatson * are met: 8174195Srwatson * 1. Redistributions of source code must retain the above copyright 9174195Srwatson * notice, this list of conditions and the following disclaimer. 10174195Srwatson * 2. Redistributions in binary form must reproduce the above copyright 11174195Srwatson * notice, this list of conditions and the following disclaimer in the 12174195Srwatson * documentation and/or other materials provided with the distribution. 13174195Srwatson * 3. All advertising materials mentioning features or use of this software 14174195Srwatson * must display the following acknowledgement: 15174195Srwatson * This product includes software developed by the University of 16174195Srwatson * California, Berkeley and its contributors. 17174195Srwatson * 4. Neither the name of the University nor the names of its contributors 18174195Srwatson * may be used to endorse or promote products derived from this software 19174195Srwatson * without specific prior written permission. 20174195Srwatson * 21174195Srwatson * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22174195Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23174195Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24174195Srwatson * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25174195Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26174195Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27174195Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28174195Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29174195Srwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30285627Szbb * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31285627Szbb * SUCH DAMAGE. 32174195Srwatson * 33174195Srwatson * $FreeBSD: head/include/dlfcn.h 50473 1999-08-27 23:45:13Z peter $ 34174195Srwatson */ 35174195Srwatson 36174195Srwatson#ifndef _DLFCN_H_ 37174195Srwatson#define _DLFCN_H_ 38174195Srwatson#include <sys/cdefs.h> 39174195Srwatson 40174195Srwatson/* 41200272Smarius * Modes for dlopen(). 42184376Smarius */ 43174195Srwatson#define RTLD_LAZY 1 /* Bind function calls lazily */ 44200272Smarius#define RTLD_NOW 2 /* Bind function calls immediately */ 45174195Srwatson 46200272Smarius/* 47174195Srwatson * Special handle argument for dlsym(). It causes the search for the 48174195Srwatson * symbol to begin in the next shared object after the one containing 49174195Srwatson * the caller. 50200272Smarius */ 51200272Smarius#define RTLD_NEXT ((void *) -1) 52200272Smarius 53200272Smarius/* 54200272Smarius * Structure filled in by dladdr(). 55184376Smarius */ 56174195Srwatsontypedef struct dl_info { 57174195Srwatson const char *dli_fname; /* Pathname of shared object */ 58174195Srwatson void *dli_fbase; /* Base address of shared object */ 59174195Srwatson const char *dli_sname; /* Name of nearest symbol */ 60174195Srwatson void *dli_saddr; /* Address of nearest symbol */ 61174195Srwatson} Dl_info; 62174195Srwatson 63174195Srwatson__BEGIN_DECLS 64174195Srwatsonint dladdr __P((const void *, Dl_info *)); 65174195Srwatsonint dlclose __P((void *)); 66200272Smariusconst char *dlerror __P((void)); 67200272Smariusvoid *dlopen __P((const char *, int)); 68200272Smariusvoid *dlsym __P((void *, const char *)); 69184376Smarius__END_DECLS 70174195Srwatson 71174195Srwatson#endif /* !_DLFCN_H_ */ 72174195Srwatson