22 #define PNG_NO_PEDANTIC_WARNINGS 24 #ifdef PNG_WRITE_SUPPORTED 36 if (png_ptr->write_data_fn !=
NULL )
37 (*(png_ptr->write_data_fn))(png_ptr,
data,
length);
39 png_error(png_ptr,
"Call to NULL write function");
42 #ifdef PNG_STDIO_SUPPORTED 48 #ifndef USE_FAR_KEYWORD 57 if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check,
NULL) )
60 check = fwrite(data, 1, length, (
png_FILE_p)(png_ptr->io_ptr));
71 #define NEAR_BUF_SIZE 1024 72 #define MIN(a,b) (a <= b ? a : b) 89 if ( !WriteFile(io_ptr, near_data, length, &check,
NULL) )
92 check = fwrite(near_data, 1, length, io_ptr);
103 written =
MIN(NEAR_BUF_SIZE, remaining);
106 if ( !WriteFile(io_ptr, buf, written, &err,
NULL) )
109 err = fwrite(buf, 1, written, io_ptr);
118 remaining -= written;
120 while (remaining != 0);
133 #ifdef PNG_WRITE_FLUSH_SUPPORTED 137 if (png_ptr->output_flush_fn !=
NULL)
138 (*(png_ptr->output_flush_fn))(png_ptr);
141 #ifdef PNG_STDIO_SUPPORTED 196 #ifdef PNG_STDIO_SUPPORTED 197 if (write_data_fn !=
NULL)
206 #ifdef PNG_WRITE_FLUSH_SUPPORTED 207 #ifdef PNG_STDIO_SUPPORTED 208 if (output_flush_fn !=
NULL)
219 if (png_ptr->read_data_fn !=
NULL)
221 png_ptr->read_data_fn =
NULL;
223 "Attempted to set both read_data_fn and write_data_fn in");
225 "the same structure. Resetting read_data_fn to NULL.");
229 #ifdef USE_FAR_KEYWORD 235 FP_OFF(near_ptr) = FP_OFF(
ptr);
236 far_ptr = (
void FAR *)near_ptr;
239 if (FP_SEG(
ptr) != FP_SEG(far_ptr))
240 png_error(png_ptr,
"segment lost in conversion");
249 near_ptr = (
void FAR *)
ptr;
250 far_ptr = (
void FAR *)near_ptr;
254 png_error(png_ptr,
"segment lost in conversion");
GLenum GLuint GLenum GLsizei length
void PNGAPI png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_voidp png_rw_ptr write_data_fn
void PNGAPI png_set_write_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)
void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
#define CVT_PTR_NOCHECK(ptr)
GLenum GLuint GLenum GLsizei const GLchar * buf
void png_flush(png_structp png_ptr)
void PNGAPI png_default_flush(png_structp png_ptr)
png_struct FAR * png_structp
#define png_error(s1, s2)
png_voidp png_rw_ptr png_flush_ptr output_flush_fn
GLsizei GLsizei GLenum GLenum const GLvoid * data
void PNGAPI png_warning(png_structp png_ptr, png_const_charp warning_message)
unsigned long png_uint_32