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
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#ifdef WIN32 |
7
|
|
|
|
|
|
|
#undef malloc |
8
|
|
|
|
|
|
|
#undef free |
9
|
|
|
|
|
|
|
#endif /* def WIN32 */ |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#include "zopfli-one.c" |
12
|
|
|
|
|
|
|
#include "gzip-zopfli-perl.c" |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
typedef gzip_zopfli_t * Gzip__Zopfli; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
MODULE=Gzip::Zopfli PACKAGE=Gzip::Zopfli |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
SV * |
21
|
|
|
|
|
|
|
ZopfliCompress(in, ...) |
22
|
|
|
|
|
|
|
SV * in; |
23
|
|
|
|
|
|
|
PREINIT: |
24
|
3
|
|
|
|
|
|
gzip_zopfli_t gz = {0}; |
25
|
|
|
|
|
|
|
CODE: |
26
|
3
|
|
|
|
|
|
gzip_zopfli_init (& gz); |
27
|
3
|
100
|
|
|
|
|
if (items > 1) { |
28
|
2
|
50
|
|
|
|
|
if ((items - 1) % 2 != 0) { |
29
|
0
|
|
|
|
|
|
warn ("odd number of arguments ignored"); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
else { |
32
|
|
|
|
|
|
|
int i; |
33
|
4
|
100
|
|
|
|
|
for (i = 1; i < items; i += 2) { |
34
|
2
|
|
|
|
|
|
gzip_zopfli_set (& gz, ST (i), ST (i + 1)); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
3
|
|
|
|
|
|
RETVAL = gzip_zopfli (& gz, in); |
39
|
|
|
|
|
|
|
OUTPUT: |
40
|
|
|
|
|
|
|
RETVAL |