Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5936 | pavelyakov | 1 | /* |
2 | 2015 |
||
3 | Author: Pavel Yakovlev. |
||
4 | */ |
||
5 | |||
6 | typedef struct |
||
7 | { |
||
8 | void *name; |
||
9 | void *function; |
||
10 | } export_t; |
||
11 | |||
12 | typedef unsigned long long qword; |
||
13 | typedef unsigned int dword; |
||
14 | typedef unsigned char byte; |
||
15 | typedef unsigned short word; |
||
16 | |||
17 | #define NULL ((void*)0) |
||
18 | |||
19 | #define quotess(name) #name |
||
20 | |||
21 | #ifdef NO_LIBIMPORT_FUNC |
||
22 | #define EXPORT_ export_t EXPORTS[]={ |
||
23 | #else |
||
24 | #define EXPORT_ export_t EXPORTS[]={{"lib_pointer_library",&lib_pointer_library}, |
||
25 | #endif |
||
26 | |||
27 | |||
28 | #define export(name) {LIB_NAME "." quotess(name),&name}, |
||
29 | #define _EXPORT { NULL, NULL }}; |
||
30 | |||
31 | #ifndef NO_LIBIMPORT_FUNC |
||
32 | static struct LIBDLL_STRUCT |
||
33 | { |
||
34 | int (*load)(char *path); |
||
35 | dword (*get)(char *name); |
||
36 | }; |
||
37 | |||
38 | static inline struct LIBDLL_STRUCT library; |
||
39 | |||
40 | static void lib_pointer_library(dword adr1,dword adr2) |
||
41 | { |
||
42 | library.load = adr1; |
||
43 | library.get = adr2; |
||
44 | } |
||
45 | #endif |