line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
/* mgx.h - provides extra mg functions */ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#ifndef mg_find_by_vtbl |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
#define mg_find_by_vtbl(sv, vtbl) my_mg_find_by_vtbl(aTHX_ sv, vtbl) |
6
|
|
|
|
|
|
|
static MAGIC* |
7
|
155
|
|
|
|
|
|
my_mg_find_by_vtbl(pTHX_ SV* const sv, const MGVTBL* const vtbl){ |
8
|
|
|
|
|
|
|
MAGIC* mg; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
assert(sv != NULL); |
11
|
196
|
100
|
|
|
|
|
for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic){ |
12
|
172
|
100
|
|
|
|
|
if(mg->mg_virtual == vtbl){ |
13
|
131
|
|
|
|
|
|
break; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
} |
16
|
155
|
|
|
|
|
|
return mg; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
/* safe version of mg_find_by_vtbl() */ |
20
|
|
|
|
|
|
|
#define MgFind(sv, vtbl) (SvMAGICAL(sv) ? mg_find_by_vtbl(sv, vtbl) : NULL) |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#endif /* !mg_find_by_vtbl */ |