line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "EXTERN.h" |
2
|
|
|
|
|
|
|
#include "perl.h" |
3
|
|
|
|
|
|
|
#include "XSUB.h" |
4
|
|
|
|
|
|
|
#include "ppport.h" |
5
|
|
|
|
|
|
|
#include |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#include "gzip-faster-perl.c" |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
typedef gzip_faster_t * Gzip__Faster; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
MODULE=Gzip::Faster PACKAGE=Gzip::Faster |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
SV * gzip (plain) |
16
|
|
|
|
|
|
|
SV * plain |
17
|
|
|
|
|
|
|
PREINIT: |
18
|
|
|
|
|
|
|
gzip_faster_t gz; |
19
|
|
|
|
|
|
|
CODE: |
20
|
5
|
|
|
|
|
|
gz.in = plain; |
21
|
5
|
|
|
|
|
|
gz.is_gzip = 1; |
22
|
5
|
|
|
|
|
|
gz.is_raw = 0; |
23
|
5
|
|
|
|
|
|
gz.user_object = 0; |
24
|
5
|
|
|
|
|
|
RETVAL = gzip_faster (& gz); |
25
|
|
|
|
|
|
|
OUTPUT: |
26
|
|
|
|
|
|
|
RETVAL |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
SV * gunzip (zipped) |
29
|
|
|
|
|
|
|
SV * zipped |
30
|
|
|
|
|
|
|
PREINIT: |
31
|
|
|
|
|
|
|
gzip_faster_t gz; |
32
|
|
|
|
|
|
|
CODE: |
33
|
9
|
|
|
|
|
|
gz.is_gzip = 1; |
34
|
9
|
|
|
|
|
|
gz.is_raw = 0; |
35
|
9
|
|
|
|
|
|
gz.in = zipped; |
36
|
9
|
|
|
|
|
|
gz.user_object = 0; |
37
|
9
|
|
|
|
|
|
RETVAL = gunzip_faster (& gz); |
38
|
|
|
|
|
|
|
OUTPUT: |
39
|
|
|
|
|
|
|
RETVAL |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
SV * deflate (plain) |
42
|
|
|
|
|
|
|
SV * plain |
43
|
|
|
|
|
|
|
PREINIT: |
44
|
|
|
|
|
|
|
gzip_faster_t gz; |
45
|
|
|
|
|
|
|
CODE: |
46
|
2
|
|
|
|
|
|
gz.in = plain; |
47
|
2
|
|
|
|
|
|
gz.is_gzip = 0; |
48
|
2
|
|
|
|
|
|
gz.is_raw = 0; |
49
|
2
|
|
|
|
|
|
gz.user_object = 0; |
50
|
2
|
|
|
|
|
|
RETVAL = gzip_faster (& gz); |
51
|
|
|
|
|
|
|
OUTPUT: |
52
|
|
|
|
|
|
|
RETVAL |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
SV * inflate (deflated) |
55
|
|
|
|
|
|
|
SV * deflated |
56
|
|
|
|
|
|
|
PREINIT: |
57
|
|
|
|
|
|
|
gzip_faster_t gz; |
58
|
|
|
|
|
|
|
CODE: |
59
|
2
|
|
|
|
|
|
gz.is_gzip = 0; |
60
|
2
|
|
|
|
|
|
gz.is_raw = 0; |
61
|
2
|
|
|
|
|
|
gz.in = deflated; |
62
|
2
|
|
|
|
|
|
gz.user_object = 0; |
63
|
2
|
|
|
|
|
|
RETVAL = gunzip_faster (& gz); |
64
|
|
|
|
|
|
|
OUTPUT: |
65
|
|
|
|
|
|
|
RETVAL |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
SV * deflate_raw (plain) |
68
|
|
|
|
|
|
|
SV * plain |
69
|
|
|
|
|
|
|
PREINIT: |
70
|
|
|
|
|
|
|
gzip_faster_t gz; |
71
|
|
|
|
|
|
|
CODE: |
72
|
3
|
|
|
|
|
|
gz.in = plain; |
73
|
3
|
|
|
|
|
|
gz.is_gzip = 0; |
74
|
3
|
|
|
|
|
|
gz.is_raw = 1; |
75
|
3
|
|
|
|
|
|
gz.user_object = 0; |
76
|
3
|
|
|
|
|
|
RETVAL = gzip_faster (& gz); |
77
|
|
|
|
|
|
|
OUTPUT: |
78
|
|
|
|
|
|
|
RETVAL |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
SV * inflate_raw (deflated) |
81
|
|
|
|
|
|
|
SV * deflated |
82
|
|
|
|
|
|
|
PREINIT: |
83
|
|
|
|
|
|
|
gzip_faster_t gz; |
84
|
|
|
|
|
|
|
CODE: |
85
|
3
|
|
|
|
|
|
gz.is_gzip = 0; |
86
|
3
|
|
|
|
|
|
gz.is_raw = 1; |
87
|
3
|
|
|
|
|
|
gz.in = deflated; |
88
|
3
|
|
|
|
|
|
gz.user_object = 0; |
89
|
3
|
|
|
|
|
|
RETVAL = gunzip_faster (& gz); |
90
|
|
|
|
|
|
|
OUTPUT: |
91
|
|
|
|
|
|
|
RETVAL |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Gzip::Faster |
94
|
|
|
|
|
|
|
new (class) |
95
|
|
|
|
|
|
|
const char * class; |
96
|
|
|
|
|
|
|
CODE: |
97
|
14
|
|
|
|
|
|
Newxz (RETVAL, 1, gzip_faster_t); |
98
|
14
|
|
|
|
|
|
new_user_object (RETVAL); |
99
|
14
|
50
|
|
|
|
|
if (! class) { |
100
|
0
|
|
|
|
|
|
croak ("No class"); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
OUTPUT: |
103
|
|
|
|
|
|
|
RETVAL |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
void |
106
|
|
|
|
|
|
|
DESTROY (gf) |
107
|
|
|
|
|
|
|
Gzip::Faster gf |
108
|
|
|
|
|
|
|
CODE: |
109
|
14
|
50
|
|
|
|
|
if (! gf->user_object) { |
110
|
0
|
|
|
|
|
|
croak ("THIS IS NOT A USER-VISIBLE OBJECT"); |
111
|
|
|
|
|
|
|
} |
112
|
14
|
|
|
|
|
|
gf_delete_file_name (gf); |
113
|
14
|
|
|
|
|
|
gf_delete_mod_time (gf); |
114
|
14
|
|
|
|
|
|
Safefree (gf); |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
void |
117
|
|
|
|
|
|
|
level (gf, level = Z_DEFAULT_COMPRESSION) |
118
|
|
|
|
|
|
|
Gzip::Faster gf; |
119
|
|
|
|
|
|
|
int level; |
120
|
|
|
|
|
|
|
CODE: |
121
|
3
|
|
|
|
|
|
set_compression_level (gf, level); |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
SV * |
124
|
|
|
|
|
|
|
zip (gf, plain) |
125
|
|
|
|
|
|
|
Gzip::Faster gf; |
126
|
|
|
|
|
|
|
SV * plain; |
127
|
|
|
|
|
|
|
CODE: |
128
|
10
|
|
|
|
|
|
gf->in = plain; |
129
|
10
|
|
|
|
|
|
RETVAL = gzip_faster (gf); |
130
|
|
|
|
|
|
|
OUTPUT: |
131
|
|
|
|
|
|
|
RETVAL |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
SV * |
134
|
|
|
|
|
|
|
unzip (gf, deflated) |
135
|
|
|
|
|
|
|
Gzip::Faster gf |
136
|
|
|
|
|
|
|
SV * deflated |
137
|
|
|
|
|
|
|
CODE: |
138
|
10
|
|
|
|
|
|
gf->in = deflated; |
139
|
10
|
|
|
|
|
|
RETVAL = gunzip_faster (gf); |
140
|
|
|
|
|
|
|
OUTPUT: |
141
|
|
|
|
|
|
|
RETVAL |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
void |
144
|
|
|
|
|
|
|
copy_perl_flags (gf, on_off) |
145
|
|
|
|
|
|
|
Gzip::Faster gf; |
146
|
|
|
|
|
|
|
SV * on_off; |
147
|
|
|
|
|
|
|
CODE: |
148
|
1
|
50
|
|
|
|
|
gf->copy_perl_flags = SvTRUE (on_off); |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
void |
151
|
|
|
|
|
|
|
raw (gf, on_off) |
152
|
|
|
|
|
|
|
Gzip::Faster gf; |
153
|
|
|
|
|
|
|
SV * on_off; |
154
|
|
|
|
|
|
|
CODE: |
155
|
1
|
50
|
|
|
|
|
gf->is_raw = SvTRUE (on_off); |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
156
|
1
|
|
|
|
|
|
gf->is_gzip = 0; |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
void |
159
|
|
|
|
|
|
|
gzip_format (gf, on_off) |
160
|
|
|
|
|
|
|
Gzip::Faster gf; |
161
|
|
|
|
|
|
|
SV * on_off; |
162
|
|
|
|
|
|
|
CODE: |
163
|
0
|
0
|
|
|
|
|
gf->is_gzip = SvTRUE (on_off); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
164
|
0
|
|
|
|
|
|
gf->is_raw = 0; |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
SV * |
167
|
|
|
|
|
|
|
file_name (gf, filename = 0) |
168
|
|
|
|
|
|
|
Gzip::Faster gf; |
169
|
|
|
|
|
|
|
SV * filename; |
170
|
|
|
|
|
|
|
CODE: |
171
|
9
|
100
|
|
|
|
|
if (filename) { |
172
|
4
|
|
|
|
|
|
gf_set_file_name (gf, filename); |
173
|
|
|
|
|
|
|
/* We increment the reference count twice, once here |
174
|
|
|
|
|
|
|
because it returns its own value, and once in |
175
|
|
|
|
|
|
|
gf_set_file_name. Unless the user captures the |
176
|
|
|
|
|
|
|
following return value, Perl then decrements it by |
177
|
|
|
|
|
|
|
one as the return value is discarded, so it has to |
178
|
|
|
|
|
|
|
be done twice. */ |
179
|
4
|
|
|
|
|
|
SvREFCNT_inc (filename); |
180
|
4
|
|
|
|
|
|
RETVAL = filename; |
181
|
|
|
|
|
|
|
} |
182
|
|
|
|
|
|
|
else { |
183
|
5
|
|
|
|
|
|
SvREFCNT_inc (gf->file_name); |
184
|
5
|
|
|
|
|
|
RETVAL = gf_get_file_name (gf); |
185
|
|
|
|
|
|
|
} |
186
|
|
|
|
|
|
|
OUTPUT: |
187
|
|
|
|
|
|
|
RETVAL |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
SV * |
190
|
|
|
|
|
|
|
mod_time (gf, modtime = 0) |
191
|
|
|
|
|
|
|
Gzip::Faster gf; |
192
|
|
|
|
|
|
|
SV * modtime; |
193
|
|
|
|
|
|
|
CODE: |
194
|
4
|
100
|
|
|
|
|
if (modtime) { |
195
|
1
|
|
|
|
|
|
gf_set_mod_time (gf, modtime); |
196
|
|
|
|
|
|
|
/* We increment the reference count twice, once here |
197
|
|
|
|
|
|
|
because it returns its own value, and once in |
198
|
|
|
|
|
|
|
gf_set_mod_time. Unless the user captures the |
199
|
|
|
|
|
|
|
following return value, Perl then decrements it by |
200
|
|
|
|
|
|
|
one as the return value is discarded, so it has to |
201
|
|
|
|
|
|
|
be done twice. */ |
202
|
1
|
|
|
|
|
|
SvREFCNT_inc (modtime); |
203
|
1
|
|
|
|
|
|
RETVAL = modtime; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
else { |
206
|
3
|
|
|
|
|
|
SvREFCNT_inc (gf->mod_time); |
207
|
3
|
|
|
|
|
|
RETVAL = gf_get_mod_time (gf); |
208
|
|
|
|
|
|
|
} |
209
|
|
|
|
|
|
|
OUTPUT: |
210
|
|
|
|
|
|
|
RETVAL |