AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
dlfcn.h
Go to the documentation of this file.
1/*
2 * dlfcn-win32
3 * Copyright (c) 2007 Ramiro Polla
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 * THE SOFTWARE.
22 */
23
24#ifndef DLFCN_H
25#define DLFCN_H
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#if defined(DLFCN_WIN32_SHARED)
32#if defined(DLFCN_WIN32_EXPORTS)
33# define DLFCN_EXPORT __declspec(dllexport)
34#else
35# define DLFCN_EXPORT __declspec(dllimport)
36#endif
37#else
38# define DLFCN_EXPORT
39#endif
40
41/* Relocations are performed when the object is loaded. */
42#define RTLD_NOW 0
43
44/* Relocations are performed at an implementation-defined time.
45 * Windows API does not support lazy symbol resolving (when first reference
46 * to a given symbol occurs). So RTLD_LAZY implementation is same as RTLD_NOW.
47 */
48#define RTLD_LAZY RTLD_NOW
49
50/* All symbols are available for relocation processing of other modules. */
51#define RTLD_GLOBAL (1 << 1)
52
53/* All symbols are not made available for relocation processing by other modules. */
54#define RTLD_LOCAL (1 << 2)
55
56/* These two were added in The Open Group Base Specifications Issue 6.
57 * Note: All other RTLD_* flags in any dlfcn.h are not standard compliant.
58 */
59
60/* The symbol lookup happens in the normal global scope. */
61#define RTLD_DEFAULT ((void *)0)
62
63/* Specifies the next object after this one that defines name. */
64#define RTLD_NEXT ((void *)-1)
65
66/* Structure filled in by dladdr() */
67typedef struct dl_info
68{
69 const char *dli_fname; /* Filename of defining object (thread unsafe and reused on every call to dladdr) */
70 void *dli_fbase; /* Load address of that object */
71 const char *dli_sname; /* Name of nearest lower symbol */
72 void *dli_saddr; /* Exact value of nearest symbol */
74
75/* Open a symbol table handle. */
76DLFCN_EXPORT void *dlopen(const char *file, int mode);
77
78/* Close a symbol table handle. */
79DLFCN_EXPORT int dlclose(void *handle);
80
81/* Get the address of a symbol from a symbol table handle. */
82DLFCN_EXPORT void *dlsym(void *handle, const char *name);
83
84/* Get diagnostic information. */
85DLFCN_EXPORT char *dlerror(void);
86
87/* Translate address to symbolic information (no POSIX standard) */
88DLFCN_EXPORT int dladdr(const void *addr, Dl_info *info);
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif /* DLFCN_H */
struct dl_info Dl_info
DLFCN_EXPORT int dlclose(void *handle)
Definition dlfcn.c:462
DLFCN_EXPORT int dladdr(const void *addr, Dl_info *info)
Definition dlfcn.c:847
DLFCN_EXPORT void * dlsym(void *handle, const char *name)
Definition dlfcn.c:487
#define DLFCN_EXPORT
Definition dlfcn.h:38
DLFCN_EXPORT void * dlopen(const char *file, int mode)
Definition dlfcn.c:355
DLFCN_EXPORT char * dlerror(void)
Definition dlfcn.c:604
Definition dlfcn.h:68
const char * dli_sname
Definition dlfcn.h:71
void * dli_saddr
Definition dlfcn.h:72
const char * dli_fname
Definition dlfcn.h:69
void * dli_fbase
Definition dlfcn.h:70