Asterisk.org: Developer Documentation (28 Oct 2009)

Wed Oct 28 15:47:53 2009

## Asterisk developer's documentation

# dlfcn-compat.h

Go to the documentation of this file.

    00001 /*
    00002  * Asterisk -- An open source telephony toolkit.
    00003  *
    00004  * See http://www.asterisk.org for more information about
    00005  * the Asterisk project. Please do not directly contact
    00006  * any of the maintainers of this project for assistance;
    00007  * the project provides a web site, mailing lists and IRC
    00008  * channels for your use.
    00009  */
    00010
    00011 /*
    00012 Copyright (c) 2002 Jorge Acereda  <jacereda@users.sourceforge.net> &
    00013                    Peter O'Gorman <ogorman@users.sourceforge.net>
    00014
    00015 Portions may be copyright others, see the AUTHORS file included with this
    00016 distribution.
    00017
    00018 Maintained by Peter O'Gorman <ogorman@users.sourceforge.net>
    00019
    00020 Bug Reports and other queries should go to <ogorman@users.sourceforge.net>
    00021
    00022 Permission is hereby granted, free of charge, to any person obtaining
    00023 a copy of this software and associated documentation files (the
    00024 "Software"), to deal in the Software without restriction, including
    00025 without limitation the rights to use, copy, modify, merge, publish,
    00026 distribute, sublicense, and/or sell copies of the Software, and to
    00027 permit persons to whom the Software is furnished to do so, subject to
    00028 the following conditions:
    00029
    00030 The above copyright notice and this permission notice shall be
    00031 included in all copies or substantial portions of the Software.
    00032
    00033 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    00034 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
    00035 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    00036 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
    00037 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    00038 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
    00039 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00040 */
    00041
    00042 #ifndef _DLFCN_H_
    00043 #define _DLFCN_H_
    00044
    00045 #ifdef __cplusplus
    00046 extern "C" {
    00047 #endif
    00048
    00049 #if defined (__GNUC__) && __GNUC__ > 3
    00050 #define dl_restrict __restrict
    00051 #else
    00052 #define dl_restrict
    00053 #endif
    00054 /*
    00055  * Structure filled in by dladdr().
    00056  */
    00057
    00058 typedef struct dl_info {
    00059         const char      *dli_fname;     /* Pathname of shared object */
    00060         void            *dli_fbase;     /* Base address of shared object */
    00061         const char      *dli_sname;     /* Name of nearest symbol */
    00062         void            *dli_saddr;     /* Address of nearest symbol */
    00063 } Dl_info;
    00064
    00065 extern void * dlopen(const char *path, int mode);
    00066 extern void * dlsym(void * dl_restrict handle, const char * dl_restrict symbol);
    00067 extern const char * dlerror(void);
    00068 extern int dlclose(void * handle);
    00069 extern int dladdr(const void * dl_restrict, Dl_info * dl_restrict);
    00070
    00071 #define RTLD_LAZY 0x1
    00072 #define RTLD_NOW  0x2
    00073 #define RTLD_LOCAL   0x4
    00074 #define RTLD_GLOBAL  0x8
    00075 #define RTLD_NOLOAD  0x10
    00076 #define RTLD_NODELETE   0x80
    00077
    00078 /*
    00079  * Special handle arguments for dlsym().
    00080  */
    00081 #define  RTLD_NEXT      ((void *) -1)  /* Search subsequent objects. */
    00082 #define  RTLD_DEFAULT   ((void *) -2)  /* Use default search algorithm. */
    00083
    00084 #ifdef __cplusplus
    00085 }
    00086 #endif
    00087
    00088 #endif /* _DLFCN_H_ */