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