line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::XSHelper; |
2
|
2
|
|
|
2
|
|
20
|
use strict; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
291
|
|
3
|
2
|
|
|
2
|
|
73
|
use warnings; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
1589
|
|
4
|
2
|
|
|
2
|
|
27
|
use utf8; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
49
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub WriteFile { |
9
|
2
|
|
50
|
2
|
1
|
17
|
my $path = shift || 'xshelper.h'; |
10
|
2
|
50
|
|
|
|
445
|
open my $fh, '>', $path |
11
|
|
|
|
|
|
|
or return 0; |
12
|
2
|
|
|
|
|
13
|
print {$fh} _xshelper_h(); |
|
2
|
|
|
|
|
10
|
|
13
|
2
|
|
|
|
|
357
|
close $fh; |
14
|
2
|
|
|
|
|
20
|
return 1; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _xshelper_h { |
18
|
2
|
|
|
2
|
|
7
|
my $h = <<'XSHELPER_H'; |
19
|
|
|
|
|
|
|
:/* THIS FILE IS AUTOMATICALLY GENERATED BY Devel::XSHelper $VERSION. */ |
20
|
|
|
|
|
|
|
:/* |
21
|
|
|
|
|
|
|
:=head1 NAME |
22
|
|
|
|
|
|
|
: |
23
|
|
|
|
|
|
|
:xshelper.h - Helper C header file for XS modules |
24
|
|
|
|
|
|
|
: |
25
|
|
|
|
|
|
|
:=head1 DESCRIPTION |
26
|
|
|
|
|
|
|
: |
27
|
|
|
|
|
|
|
: // This includes all the perl header files and ppport.h |
28
|
|
|
|
|
|
|
: #include "xshelper.h" |
29
|
|
|
|
|
|
|
: |
30
|
|
|
|
|
|
|
:=head1 SEE ALSO |
31
|
|
|
|
|
|
|
: |
32
|
|
|
|
|
|
|
:L, where this file is distributed as a part of |
33
|
|
|
|
|
|
|
: |
34
|
|
|
|
|
|
|
:=head1 AUTHOR |
35
|
|
|
|
|
|
|
: |
36
|
|
|
|
|
|
|
:Fuji, Goro (gfx) Egfuji at cpan.orgE |
37
|
|
|
|
|
|
|
: |
38
|
|
|
|
|
|
|
:=head1 LISENCE |
39
|
|
|
|
|
|
|
: |
40
|
|
|
|
|
|
|
:Copyright (c) 2010, Fuji, Goro (gfx). All rights reserved. |
41
|
|
|
|
|
|
|
: |
42
|
|
|
|
|
|
|
:This library is free software; you can redistribute it and/or modify |
43
|
|
|
|
|
|
|
:it under the same terms as Perl itself. |
44
|
|
|
|
|
|
|
: |
45
|
|
|
|
|
|
|
:=cut |
46
|
|
|
|
|
|
|
:*/ |
47
|
|
|
|
|
|
|
: |
48
|
|
|
|
|
|
|
:#ifdef __cplusplus |
49
|
|
|
|
|
|
|
:extern "C" { |
50
|
|
|
|
|
|
|
:#endif |
51
|
|
|
|
|
|
|
: |
52
|
|
|
|
|
|
|
:#define PERL_NO_GET_CONTEXT /* we want efficiency */ |
53
|
|
|
|
|
|
|
:#include |
54
|
|
|
|
|
|
|
:#include |
55
|
|
|
|
|
|
|
:#define NO_XSLOCKS /* for exceptions */ |
56
|
|
|
|
|
|
|
:#include |
57
|
|
|
|
|
|
|
: |
58
|
|
|
|
|
|
|
:#ifdef __cplusplus |
59
|
|
|
|
|
|
|
:} /* extern "C" */ |
60
|
|
|
|
|
|
|
:#endif |
61
|
|
|
|
|
|
|
: |
62
|
|
|
|
|
|
|
:#include "ppport.h" |
63
|
|
|
|
|
|
|
: |
64
|
|
|
|
|
|
|
:/* portability stuff not supported by ppport.h yet */ |
65
|
|
|
|
|
|
|
: |
66
|
|
|
|
|
|
|
:#ifndef STATIC_INLINE /* from 5.13.4 */ |
67
|
|
|
|
|
|
|
:# if defined(__GNUC__) || defined(__cplusplus) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) |
68
|
|
|
|
|
|
|
:# define STATIC_INLINE static inline |
69
|
|
|
|
|
|
|
:# else |
70
|
|
|
|
|
|
|
:# define STATIC_INLINE static |
71
|
|
|
|
|
|
|
:# endif |
72
|
|
|
|
|
|
|
:#endif /* STATIC_INLINE */ |
73
|
|
|
|
|
|
|
: |
74
|
|
|
|
|
|
|
:#ifndef __attribute__format__ |
75
|
|
|
|
|
|
|
:#define __attribute__format__(a,b,c) /* nothing */ |
76
|
|
|
|
|
|
|
:#endif |
77
|
|
|
|
|
|
|
: |
78
|
|
|
|
|
|
|
:#ifndef LIKELY /* they are just a compiler's hint */ |
79
|
|
|
|
|
|
|
:#define LIKELY(x) (!!(x)) |
80
|
|
|
|
|
|
|
:#define UNLIKELY(x) (!!(x)) |
81
|
|
|
|
|
|
|
:#endif |
82
|
|
|
|
|
|
|
: |
83
|
|
|
|
|
|
|
:#ifndef newSVpvs_share |
84
|
|
|
|
|
|
|
:#define newSVpvs_share(s) Perl_newSVpvn_share(aTHX_ STR_WITH_LEN(s), 0U) |
85
|
|
|
|
|
|
|
:#endif |
86
|
|
|
|
|
|
|
: |
87
|
|
|
|
|
|
|
:#ifndef get_cvs |
88
|
|
|
|
|
|
|
:#define get_cvs(name, flags) get_cv(name, flags) |
89
|
|
|
|
|
|
|
:#endif |
90
|
|
|
|
|
|
|
: |
91
|
|
|
|
|
|
|
:#ifndef GvNAME_get |
92
|
|
|
|
|
|
|
:#define GvNAME_get GvNAME |
93
|
|
|
|
|
|
|
:#endif |
94
|
|
|
|
|
|
|
:#ifndef GvNAMELEN_get |
95
|
|
|
|
|
|
|
:#define GvNAMELEN_get GvNAMELEN |
96
|
|
|
|
|
|
|
:#endif |
97
|
|
|
|
|
|
|
: |
98
|
|
|
|
|
|
|
:#ifndef CvGV_set |
99
|
|
|
|
|
|
|
:#define CvGV_set(cv, gv) (CvGV(cv) = (gv)) |
100
|
|
|
|
|
|
|
:#endif |
101
|
|
|
|
|
|
|
: |
102
|
|
|
|
|
|
|
:/* general utility */ |
103
|
|
|
|
|
|
|
: |
104
|
|
|
|
|
|
|
:#if PERL_BCDVERSION >= 0x5008005 |
105
|
|
|
|
|
|
|
:#define LooksLikeNumber(x) looks_like_number(x) |
106
|
|
|
|
|
|
|
:#else |
107
|
|
|
|
|
|
|
:#define LooksLikeNumber(x) (SvPOKp(x) ? looks_like_number(x) : (I32)SvNIOKp(x)) |
108
|
|
|
|
|
|
|
:#endif |
109
|
|
|
|
|
|
|
: |
110
|
|
|
|
|
|
|
:#define newAV_mortal() (AV*)sv_2mortal((SV*)newAV()) |
111
|
|
|
|
|
|
|
:#define newHV_mortal() (HV*)sv_2mortal((SV*)newHV()) |
112
|
|
|
|
|
|
|
:#define newRV_inc_mortal(sv) sv_2mortal(newRV_inc(sv)) |
113
|
|
|
|
|
|
|
:#define newRV_noinc_mortal(sv) sv_2mortal(newRV_noinc(sv)) |
114
|
|
|
|
|
|
|
: |
115
|
|
|
|
|
|
|
:#define DECL_BOOT(name) EXTERN_C XS(CAT2(boot_, name)) |
116
|
|
|
|
|
|
|
:#define CALL_BOOT(name) STMT_START { \ |
117
|
|
|
|
|
|
|
: PUSHMARK(SP); \ |
118
|
|
|
|
|
|
|
: CALL_FPTR(CAT2(boot_, name))(aTHX_ cv); \ |
119
|
|
|
|
|
|
|
: } STMT_END |
120
|
|
|
|
|
|
|
XSHELPER_H |
121
|
2
|
|
|
|
|
300
|
$h =~ s/^://xmsg; |
122
|
2
|
|
|
|
|
107
|
$h =~ s/\$VERSION\b/$Devel::XSHelper::VERSION/xms; |
123
|
2
|
|
|
|
|
81
|
return $h; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
1; |
127
|
|
|
|
|
|
|
__END__ |