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: def |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# WRITTEN BY: Marcus Holland-Moritz ON: Mar 2002 |
15
|
|
|
|
|
|
|
# CHANGED BY: ON: |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
################################################################################ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
char * |
20
|
|
|
|
|
|
|
CBC::def(type) |
21
|
|
|
|
|
|
|
const char *type |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
PREINIT: |
24
|
267
|
|
|
|
|
|
CBC_METHOD(def); |
25
|
|
|
|
|
|
|
MemberInfo mi; |
26
|
267
|
|
|
|
|
|
const char *member = NULL; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
CODE: |
29
|
|
|
|
|
|
|
CT_DEBUG_METHOD1("'%s'", type); |
30
|
|
|
|
|
|
|
|
31
|
297
|
100
|
|
|
|
|
CHECK_VOID_CONTEXT; |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
255
|
100
|
|
|
|
|
if (get_type_spec(THIS, type, &member, &mi.type) == 0) |
34
|
30
|
|
|
|
|
|
XSRETURN_UNDEF; |
35
|
|
|
|
|
|
|
|
36
|
225
|
100
|
|
|
|
|
if (mi.type.ptr == NULL) |
37
|
4
|
|
|
|
|
|
RETVAL = "basic"; |
38
|
|
|
|
|
|
|
else |
39
|
|
|
|
|
|
|
{ |
40
|
221
|
|
|
|
|
|
void *ptr = mi.type.ptr; |
41
|
221
|
|
|
|
|
|
switch (GET_CTYPE(ptr)) |
42
|
|
|
|
|
|
|
{ |
43
|
|
|
|
|
|
|
case TYP_TYPEDEF: |
44
|
143
|
100
|
|
|
|
|
RETVAL = is_typedef_defined((Typedef *) ptr) ? "typedef" : ""; |
45
|
143
|
|
|
|
|
|
break; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
case TYP_STRUCT: |
48
|
75
|
100
|
|
|
|
|
if (((Struct *) ptr)->declarations) |
49
|
73
|
100
|
|
|
|
|
RETVAL = ((Struct *) ptr)->tflags & T_STRUCT ? "struct" : "union"; |
50
|
|
|
|
|
|
|
else |
51
|
2
|
|
|
|
|
|
RETVAL = ""; |
52
|
75
|
|
|
|
|
|
break; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
case TYP_ENUM: |
55
|
3
|
50
|
|
|
|
|
RETVAL = ((EnumSpecifier *) ptr)->enumerators ? "enum" : ""; |
56
|
3
|
|
|
|
|
|
break; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
default: |
59
|
0
|
|
|
|
|
|
fatal("Invalid type (%d) in " XSCLASS "::%s( '%s' )", |
60
|
|
|
|
|
|
|
GET_CTYPE(ptr), method, type); |
61
|
|
|
|
|
|
|
break; |
62
|
|
|
|
|
|
|
} |
63
|
221
|
50
|
|
|
|
|
if (member && *member != '\0' && *RETVAL != '\0') |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
64
|
|
|
|
|
|
|
{ |
65
|
22
|
|
|
|
|
|
mi.pDecl = NULL; |
66
|
22
|
|
|
|
|
|
mi.level = 0; |
67
|
44
|
|
|
|
|
|
RETVAL = get_member(aTHX_ &mi, member, NULL, CBC_GM_DONT_CROAK | CBC_GM_NO_OFFSET_SIZE_CALC) |
68
|
22
|
100
|
|
|
|
|
? "member" : ""; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
OUTPUT: |
73
|
|
|
|
|
|
|
RETVAL |
74
|
|
|
|
|
|
|
|