line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
################################################################################ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2002-2020 Marcus Holland-Moritz. All rights reserved. |
4
|
|
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify |
5
|
|
|
|
|
|
|
# it under the same terms as Perl itself. |
6
|
|
|
|
|
|
|
# |
7
|
|
|
|
|
|
|
################################################################################ |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
################################################################################ |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
# METHOD: typedef_names |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002 |
15
|
|
|
|
|
|
|
# CHANGED BY: ON: |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
################################################################################ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
void |
20
|
|
|
|
|
|
|
CBC::typedef_names() |
21
|
|
|
|
|
|
|
PREINIT: |
22
|
63
|
|
|
|
|
|
CBC_METHOD(typedef_names); |
23
|
|
|
|
|
|
|
ListIterator tli, ti; |
24
|
|
|
|
|
|
|
TypedefList *pTDL; |
25
|
|
|
|
|
|
|
Typedef *pTypedef; |
26
|
63
|
|
|
|
|
|
int count = 0; |
27
|
|
|
|
|
|
|
U32 context; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
PPCODE: |
30
|
|
|
|
|
|
|
CT_DEBUG_METHOD; |
31
|
|
|
|
|
|
|
|
32
|
63
|
100
|
|
|
|
|
CHECK_PARSE_DATA; |
33
|
57
|
100
|
|
|
|
|
CHECK_VOID_CONTEXT; |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
51
|
50
|
|
|
|
|
context = GIMME_V; |
36
|
|
|
|
|
|
|
|
37
|
1114
|
100
|
|
|
|
|
LL_foreach(pTDL, tli, THIS->cpi.typedef_lists) |
|
|
100
|
|
|
|
|
|
38
|
2154
|
100
|
|
|
|
|
LL_foreach(pTypedef, ti, pTDL->typedefs) |
|
|
100
|
|
|
|
|
|
39
|
1091
|
50
|
|
|
|
|
if (is_typedef_defined(pTypedef)) |
40
|
|
|
|
|
|
|
{ |
41
|
1091
|
100
|
|
|
|
|
if (context == G_ARRAY) |
42
|
692
|
50
|
|
|
|
|
XPUSHs(sv_2mortal(newSVpv(pTypedef->pDecl->identifier, 0))); |
43
|
1091
|
|
|
|
|
|
count++; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
51
|
100
|
|
|
|
|
if (context == G_ARRAY) |
47
|
43
|
|
|
|
|
|
XSRETURN(count); |
48
|
|
|
|
|
|
|
else |
49
|
57
|
|
|
|
|
|
XSRETURN_IV(count); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
################################################################################ |
53
|
|
|
|
|
|
|
# |
54
|
|
|
|
|
|
|
# METHOD: typedef |
55
|
|
|
|
|
|
|
# |
56
|
|
|
|
|
|
|
# WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002 |
57
|
|
|
|
|
|
|
# CHANGED BY: ON: |
58
|
|
|
|
|
|
|
# |
59
|
|
|
|
|
|
|
################################################################################ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
void |
62
|
|
|
|
|
|
|
CBC::typedef(...) |
63
|
|
|
|
|
|
|
PREINIT: |
64
|
473
|
|
|
|
|
|
CBC_METHOD(typedef); |
65
|
|
|
|
|
|
|
Typedef *pTypedef; |
66
|
|
|
|
|
|
|
U32 context; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
PPCODE: |
69
|
|
|
|
|
|
|
CT_DEBUG_METHOD; |
70
|
|
|
|
|
|
|
|
71
|
473
|
100
|
|
|
|
|
CHECK_PARSE_DATA; |
72
|
467
|
100
|
|
|
|
|
CHECK_VOID_CONTEXT; |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
461
|
50
|
|
|
|
|
context = GIMME_V; |
75
|
|
|
|
|
|
|
|
76
|
461
|
100
|
|
|
|
|
if (context == G_SCALAR && items != 2) |
|
|
100
|
|
|
|
|
|
77
|
9
|
100
|
|
|
|
|
XSRETURN_IV(items > 1 ? items-1 : HT_count(THIS->cpi.htTypedefs)); |
78
|
|
|
|
|
|
|
|
79
|
452
|
50
|
|
|
|
|
NEED_PARSE_DATA; |
|
|
100
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
452
|
100
|
|
|
|
|
if (items > 1) |
82
|
|
|
|
|
|
|
{ |
83
|
|
|
|
|
|
|
int i; |
84
|
|
|
|
|
|
|
|
85
|
897
|
100
|
|
|
|
|
for (i = 1; i < items; i++) |
86
|
|
|
|
|
|
|
{ |
87
|
479
|
50
|
|
|
|
|
const char *name = SvPV_nolen(ST(i)); |
88
|
|
|
|
|
|
|
|
89
|
479
|
|
|
|
|
|
pTypedef = HT_get(THIS->cpi.htTypedefs, name, 0, 0); |
90
|
|
|
|
|
|
|
|
91
|
479
|
100
|
|
|
|
|
if (pTypedef) |
92
|
466
|
|
|
|
|
|
PUSHs(sv_2mortal(get_typedef_def(aTHX_ &THIS->cfg, pTypedef))); |
93
|
|
|
|
|
|
|
else |
94
|
13
|
|
|
|
|
|
PUSHs(&PL_sv_undef); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
418
|
|
|
|
|
|
XSRETURN(items-1); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
else |
100
|
|
|
|
|
|
|
{ |
101
|
|
|
|
|
|
|
ListIterator tli, ti; |
102
|
|
|
|
|
|
|
TypedefList *pTDL; |
103
|
34
|
|
|
|
|
|
int size = HT_count(THIS->cpi.htTypedefs); |
104
|
|
|
|
|
|
|
|
105
|
34
|
100
|
|
|
|
|
if (size <= 0) |
106
|
16
|
|
|
|
|
|
XSRETURN_EMPTY; |
107
|
|
|
|
|
|
|
|
108
|
18
|
50
|
|
|
|
|
EXTEND(SP, size); |
|
|
50
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
258
|
100
|
|
|
|
|
LL_foreach(pTDL, tli, THIS->cpi.typedef_lists) |
|
|
100
|
|
|
|
|
|
111
|
486
|
100
|
|
|
|
|
LL_foreach(pTypedef, ti, pTDL->typedefs) |
|
|
100
|
|
|
|
|
|
112
|
246
|
|
|
|
|
|
PUSHs(sv_2mortal(get_typedef_def(aTHX_ &THIS->cfg, pTypedef))); |
113
|
|
|
|
|
|
|
|
114
|
34
|
|
|
|
|
|
XSRETURN(size); |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|