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: offsetof |
13
|
|
|
|
|
|
|
# |
14
|
|
|
|
|
|
|
# WRITTEN BY: Marcus Holland-Moritz ON: Mar 2002 |
15
|
|
|
|
|
|
|
# CHANGED BY: ON: |
16
|
|
|
|
|
|
|
# |
17
|
|
|
|
|
|
|
################################################################################ |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
SV * |
20
|
|
|
|
|
|
|
CBC::offsetof(type, member) |
21
|
|
|
|
|
|
|
const char *type |
22
|
|
|
|
|
|
|
const char *member |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
PREINIT: |
25
|
80439
|
|
|
|
|
|
CBC_METHOD(offsetof); |
26
|
|
|
|
|
|
|
MemberInfo mi, mi2; |
27
|
80439
|
|
|
|
|
|
const char *m = member; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
CODE: |
30
|
|
|
|
|
|
|
CT_DEBUG_METHOD2("'%s', '%s'", type, member); |
31
|
|
|
|
|
|
|
|
32
|
80439
|
100
|
|
|
|
|
CHECK_PARSE_DATA; |
33
|
80433
|
100
|
|
|
|
|
CHECK_VOID_CONTEXT; |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
80439
|
100
|
|
|
|
|
while (isSPACE(*m)) |
36
|
12
|
|
|
|
|
|
m++; |
37
|
|
|
|
|
|
|
|
38
|
80427
|
100
|
|
|
|
|
if (*m == '\0') |
39
|
14
|
100
|
|
|
|
|
WARN((aTHX_ "Empty string passed as member expression")); |
40
|
|
|
|
|
|
|
|
41
|
80427
|
50
|
|
|
|
|
NEED_PARSE_DATA; |
|
|
100
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
80427
|
100
|
|
|
|
|
if (!get_member_info(aTHX_ THIS, type, &mi, 0)) |
44
|
12
|
|
|
|
|
|
Perl_croak(aTHX_ "Cannot find '%s'", type); |
45
|
|
|
|
|
|
|
|
46
|
80391
|
|
|
|
|
|
(void) get_member(aTHX_ &mi, member, &mi2, CBC_GM_ACCEPT_DOTLESS_MEMBER); |
47
|
|
|
|
|
|
|
|
48
|
80169
|
100
|
|
|
|
|
if (mi2.pDecl && mi2.pDecl->bitfield_flag) |
|
|
100
|
|
|
|
|
|
49
|
6
|
|
|
|
|
|
Perl_croak(aTHX_ "Cannot use %s on bitfields", method); |
50
|
|
|
|
|
|
|
|
51
|
80163
|
100
|
|
|
|
|
if (mi.flags) |
52
|
18
|
100
|
|
|
|
|
WARN_FLAGS(type, mi.flags); |
|
|
100
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
80163
|
|
|
|
|
|
RETVAL = newSViv(mi2.offset); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
OUTPUT: |
57
|
|
|
|
|
|
|
RETVAL |
58
|
|
|
|
|
|
|
|