forked from node-ffi/node-ffi
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathwin32-dlfcn.h
65 lines (51 loc) · 1.08 KB
/
win32-dlfcn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* @file Minimal emulation of POSIX dlopen/dlsym/dlclose on Windows.
* @license Public domain.
*
* This code works fine for the common scenario of loading a
* specific DLL and calling one (or more) functions within it.
* No attempt is made to emulate POSIX symbol table semantics.
*/
#ifndef _INCLUDE_DLFCN_H_
#define _INCLUDE_DLFCN_H_
#ifdef __cplusplus
extern "C" {
#endif
#define RTLD_LAZY 0
#define RTLD_NOW 0
#define RTLD_GLOBAL 0
#define RTLD_LOCAL 0
#define RTLD_DEFAULT ((void*) NULL)
#define RTLD_NEXT ((void*) NULL)
/**
* Open DLL, returning a handle.
*/
void*
dlopen(
const char *file, /** DLL filename. */
int mode /** mode flags (ignored). */
);
/**
* Close DLL.
*/
int
dlclose(
void* handle /** Handle from dlopen(). */
);
/**
* Look up symbol exported by DLL.
*/
void*
dlsym(
void* handle, /** Handle from dlopen(). */
const char* name /** Name of exported symbol. */
);
/**
* Return message describing last error.
*/
char*
dlerror(void);
#ifdef __cplusplus
}
#endif
#endif