update Changes
[imager.git] / PNG / PNG.xs
1 #define PERL_NO_GET_CONTEXT
2 #ifdef __cplusplus
3 extern "C" {
4 #endif
5 #include "EXTERN.h"
6 #include "perl.h"
7 #include "XSUB.h"
8 #include "imext.h"
9 #include "imperl.h"
10 #include "impng.h"
11
12 DEFINE_IMAGER_CALLBACKS;
13
14 MODULE = Imager::File::PNG  PACKAGE = Imager::File::PNG
15
16 Imager::ImgRaw
17 i_readpng_wiol(ig, flags=0)
18         Imager::IO     ig
19         int            flags
20
21 undef_int
22 i_writepng_wiol(im, ig)
23     Imager::ImgRaw     im
24         Imager::IO     ig
25
26 unsigned
27 i_png_lib_version()
28
29 MODULE = Imager::File::PNG  PACKAGE = Imager::File::PNG PREFIX=i_png_
30
31 void
32 i_png_features(...)
33   PREINIT:
34     const char * const *p;
35   PPCODE:
36     p = i_png_features();
37     while (*p) {
38       EXTEND(SP, 1);
39       PUSHs(sv_2mortal(newSVpv(*p, 0)));
40       ++p;
41     }
42
43 int
44 IMPNG_READ_IGNORE_BENIGN_ERRORS()
45   CODE:
46     RETVAL = IMPNG_READ_IGNORE_BENIGN_ERRORS;
47   OUTPUT:
48     RETVAL
49
50 BOOT:
51         PERL_INITIALIZE_IMAGER_CALLBACKS;