22 #define PNG_NO_PEDANTIC_WARNINGS 24 #ifdef PNG_READ_SUPPORTED 35 png_debug1(4,
"reading %d bytes", (
int)length);
37 if (png_ptr->read_data_fn !=
NULL)
38 (*(png_ptr->read_data_fn))(png_ptr,
data,
length);
40 png_error(png_ptr,
"Call to NULL read function");
43 #ifdef PNG_STDIO_SUPPORTED 49 #ifndef USE_FAR_KEYWORD 61 if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check,
NULL) )
77 #define NEAR_BUF_SIZE 1024 78 #define MIN(a,b) (a <= b ? a : b) 95 if ( !ReadFile((HANDLE)(png_ptr->io_ptr),
data, length, &check,
99 check = fread(n_data, 1, length, io_ptr);
110 read =
MIN(NEAR_BUF_SIZE, remaining);
112 if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err,
NULL) )
115 err = fread(buf, (
png_size_t)1, read, io_ptr);
125 while (remaining != 0);
157 #ifdef PNG_STDIO_SUPPORTED 158 if (read_data_fn !=
NULL)
167 if (png_ptr->write_data_fn !=
NULL)
169 png_ptr->write_data_fn =
NULL;
171 "It's an error to set both read_data_fn and write_data_fn in the ");
173 "same structure. Resetting write_data_fn to NULL.");
176 #ifdef PNG_WRITE_FLUSH_SUPPORTED 177 png_ptr->output_flush_fn =
NULL;
GLenum GLuint GLenum GLsizei length
int read(int fd, char *buf, int nbytes)
#define CVT_PTR_NOCHECK(ptr)
GLenum GLuint GLenum GLsizei const GLchar * buf
png_struct FAR * png_structp
#define png_error(s1, s2)
GLsizei GLsizei GLenum GLenum const GLvoid * data
void PNGAPI png_warning(png_structp png_ptr, png_const_charp warning_message)
#define png_debug1(l, m, p1)
void PNGAPI png_set_read_fn(png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)
void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_voidp png_rw_ptr read_data_fn
void PNGAPI png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
unsigned long png_uint_32