line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODULE = FFI::Platypus PACKAGE = FFI::Platypus::DL |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
BOOT: |
4
|
|
|
|
|
|
|
{ |
5
|
|
|
|
|
|
|
HV *stash; |
6
|
56
|
|
|
|
|
|
stash = gv_stashpv("FFI::Platypus::DL", TRUE); |
7
|
|
|
|
|
|
|
#ifdef RTLD_LAZY |
8
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_PLATYPUS_DEFAULT", newSViv(RTLD_LAZY)); |
9
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_LAZY", newSViv(RTLD_LAZY)); |
10
|
|
|
|
|
|
|
#else |
11
|
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_PLATYPUS_DEFAULT", newSViv(0)); |
12
|
|
|
|
|
|
|
#endif |
13
|
|
|
|
|
|
|
#ifdef RTLD_NOW |
14
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_NOW", newSViv(RTLD_NOW)); |
15
|
|
|
|
|
|
|
#endif |
16
|
|
|
|
|
|
|
#ifdef RTLD_GLOBAL |
17
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_GLOBAL", newSViv(RTLD_GLOBAL)); |
18
|
|
|
|
|
|
|
#endif |
19
|
|
|
|
|
|
|
#ifdef RTLD_LOCAL |
20
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_LOCAL", newSViv(RTLD_LOCAL)); |
21
|
|
|
|
|
|
|
#endif |
22
|
|
|
|
|
|
|
#ifdef RTLD_NODELETE |
23
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_NODELETE", newSViv(RTLD_NODELETE)); |
24
|
|
|
|
|
|
|
#endif |
25
|
|
|
|
|
|
|
#ifdef RTLD_NOLOAD |
26
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_NOLOAD", newSViv(RTLD_NOLOAD)); |
27
|
|
|
|
|
|
|
#endif |
28
|
|
|
|
|
|
|
#ifdef RTLD_DEEPBIND |
29
|
56
|
|
|
|
|
|
newCONSTSUB(stash, "RTLD_DEEPBIND", newSViv(RTLD_DEEPBIND)); |
30
|
|
|
|
|
|
|
#endif |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
void * |
34
|
|
|
|
|
|
|
dlopen(filename, flags); |
35
|
|
|
|
|
|
|
ffi_pl_string filename |
36
|
|
|
|
|
|
|
int flags |
37
|
|
|
|
|
|
|
INIT: |
38
|
|
|
|
|
|
|
void *ptr; |
39
|
|
|
|
|
|
|
CODE: |
40
|
188
|
|
|
|
|
|
ptr = dlopen(filename, flags); |
41
|
188
|
100
|
|
|
|
|
if(ptr == NULL) |
42
|
|
|
|
|
|
|
{ |
43
|
3
|
|
|
|
|
|
XSRETURN_EMPTY; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
else |
46
|
|
|
|
|
|
|
{ |
47
|
185
|
|
|
|
|
|
RETVAL = ptr; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
OUTPUT: |
50
|
|
|
|
|
|
|
RETVAL |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
const char * |
53
|
|
|
|
|
|
|
dlerror(); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
void * |
56
|
|
|
|
|
|
|
dlsym(handle, symbol); |
57
|
|
|
|
|
|
|
void *handle |
58
|
|
|
|
|
|
|
const char *symbol |
59
|
|
|
|
|
|
|
INIT: |
60
|
|
|
|
|
|
|
void *ptr; |
61
|
|
|
|
|
|
|
CODE: |
62
|
1204
|
|
|
|
|
|
ptr = dlsym(handle, symbol); |
63
|
1204
|
100
|
|
|
|
|
if(ptr == NULL) |
64
|
|
|
|
|
|
|
{ |
65
|
127
|
|
|
|
|
|
XSRETURN_EMPTY; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
else |
68
|
|
|
|
|
|
|
{ |
69
|
1077
|
|
|
|
|
|
RETVAL = ptr; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
OUTPUT: |
72
|
|
|
|
|
|
|
RETVAL |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
int |
75
|
|
|
|
|
|
|
dlclose(handle); |
76
|
|
|
|
|
|
|
void *handle |
77
|
|
|
|
|
|
|
CODE: |
78
|
185
|
100
|
|
|
|
|
if(!PL_dirty) |
79
|
79
|
|
|
|
|
|
RETVAL = dlclose(handle); |
80
|
|
|
|
|
|
|
else |
81
|
106
|
|
|
|
|
|
RETVAL = 0; |
82
|
|
|
|
|
|
|
OUTPUT: |
83
|
|
|
|
|
|
|
RETVAL |