Imported from libpng-1.2.13rc2.tar

This commit is contained in:
Glenn Randers-Pehrson
2006-11-13 14:14:21 -06:00
parent 2e3980e1de
commit e88a5eca8b
55 changed files with 1136 additions and 134 deletions

View File

@@ -1,7 +1,7 @@
/* pngwio.c - functions for data output
*
* Last changed in libpng 1.2.3 - May 21, 2002
* Last changed in libpng 1.2.13 November 13, 2006
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2002 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -45,6 +45,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_uint_32 check;
if(png_ptr == NULL) return;
#if defined(_WIN32_WCE)
if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
check = 0;
@@ -70,6 +71,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_byte *near_data; /* Needs to be "png_byte *" instead of "png_bytep" */
png_FILE_p io_ptr;
if(png_ptr == NULL) return;
/* Check if data really is near. If so, use usual code. */
near_data = (png_byte *)CVT_PTR_NOCHECK(data);
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
@@ -129,6 +131,7 @@ png_flush(png_structp png_ptr)
void PNGAPI
png_default_flush(png_structp png_ptr)
{
if(png_ptr == NULL) return;
#if !defined(_WIN32_WCE)
png_FILE_p io_ptr;
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
@@ -165,6 +168,7 @@ 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)
{
if(png_ptr == NULL) return;
png_ptr->io_ptr = io_ptr;
#if !defined(PNG_NO_STDIO)