else
*pngxPP = pngxP;
}
pngxP->rw = rw;
void
pngx_destroy(struct pngx * const pngxP) {
png_destroy_write_struct(&pngxP->png_ptr, &pngxP->info_ptr);
switch(pngxP->rw) {
case PNGX_READ:
png_destroy_read_struct(&pngxP->png_ptr, &pngxP->info_ptr, NULL);
break;
case PNGX_WRITE:
free(pngxP);
the PNG library easier and cleaner.
*/
typedef enum {PNGX_READ, PNGX_WRITE} pngx_rw;
struct pngx {
png_structp png_ptr;
png_infop info_ptr;
pngx_rw rw;
};
pngx_create(struct pngx ** const pngxPP,
pngx_rw const rw,