NEURON
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 /*
25  * From https://github.com/dlfcn-win32/dlfcn-win32
26  * Filtered with dos2unix and clang-format.
27  */
28 
29 #ifndef DLFCN_H
30 #define DLFCN_H
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #if defined(DLFCN_WIN32_SHARED)
37 #if defined(DLFCN_WIN32_EXPORTS)
38 #define DLFCN_EXPORT __declspec(dllexport)
39 #else
40 #define DLFCN_EXPORT __declspec(dllimport)
41 #endif
42 #else
43 #define DLFCN_EXPORT
44 #endif
45 
46 /* Relocations are performed when the object is loaded. */
47 #define RTLD_NOW 0
48 
49 /* Relocations are performed at an implementation-defined time.
50  * Windows API does not support lazy symbol resolving (when first reference
51  * to a given symbol occurs). So RTLD_LAZY implementation is same as RTLD_NOW.
52  */
53 #define RTLD_LAZY RTLD_NOW
54 
55 /* All symbols are available for relocation processing of other modules. */
56 #define RTLD_GLOBAL (1 << 1)
57 
58 /* All symbols are not made available for relocation processing by other modules. */
59 #define RTLD_LOCAL (1 << 2)
60 
61 /* These two were added in The Open Group Base Specifications Issue 6.
62  * Note: All other RTLD_* flags in any dlfcn.h are not standard compliant.
63  */
64 
65 /* The symbol lookup happens in the normal global scope. */
66 #define RTLD_DEFAULT ((void*) 0)
67 
68 /* Specifies the next object after this one that defines name. */
69 #define RTLD_NEXT ((void*) -1)
70 
71 /* Structure filled in by dladdr() */
72 typedef struct dl_info {
73  const char* dli_fname; /* Filename of defining object (thread unsafe and reused on every call to
74  dladdr) */
75  void* dli_fbase; /* Load address of that object */
76  const char* dli_sname; /* Name of nearest lower symbol */
77  void* dli_saddr; /* Exact value of nearest symbol */
79 
80 /* Open a symbol table handle. */
81 DLFCN_EXPORT void* dlopen(const char* file, int mode);
82 
83 /* Close a symbol table handle. */
84 DLFCN_EXPORT int dlclose(void* handle);
85 
86 /* Get the address of a symbol from a symbol table handle. */
87 DLFCN_EXPORT void* dlsym(void* handle, const char* name);
88 
89 /* Get diagnostic information. */
90 DLFCN_EXPORT char* dlerror(void);
91 
92 /* Translate address to symbolic information (no POSIX standard) */
93 DLFCN_EXPORT int dladdr(const void* addr, Dl_info* info);
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif /* DLFCN_H */
DLFCN_EXPORT void * dlsym(void *handle, const char *name)
Definition: dlfcn.c:447
struct dl_info Dl_info
DLFCN_EXPORT void * dlopen(const char *file, int mode)
Definition: dlfcn.c:331
DLFCN_EXPORT char * dlerror(void)
Definition: dlfcn.c:548
DLFCN_EXPORT int dlclose(void *handle)
Definition: dlfcn.c:423
DLFCN_EXPORT int dladdr(const void *addr, Dl_info *info)
Definition: dlfcn.c:731
#define DLFCN_EXPORT
Definition: dlfcn.h:43
const char * name
Definition: init.cpp:16
handle_interface< non_owning_identifier< storage > > handle
Non-owning handle to a Mechanism instance.
static List * info
Definition: dlfcn.h:72
const char * dli_sname
Definition: dlfcn.h:76
void * dli_saddr
Definition: dlfcn.h:77
const char * dli_fname
Definition: dlfcn.h:73
void * dli_fbase
Definition: dlfcn.h:75