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
|
|
|
|
|
|
|
my_mg_find_by_vtbl(pTHX_ SV* const sv, const MGVTBL* const vtbl){ |
8
|
|
|
|
|
|
|
MAGIC* mg; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
assert(sv != NULL); |
11
|
202
|
50
|
|
|
|
|
for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic){ |
|
|
100
|
|
|
|
|
|
12
|
201
|
50
|
|
|
|
|
if(mg->mg_virtual == vtbl){ |
|
|
100
|
|
|
|
|
|
13
|
|
|
|
|
|
|
break; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
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 */ |