Back to index

plt-scheme  4.2.1
Defines | Functions
pngwio.c File Reference
#include "png.h"

Go to the source code of this file.

Defines

#define PNG_INTERNAL

Functions

void png_write_data (png_structp png_ptr, png_bytep data, png_size_t length)
void PNGAPI png_default_write_data (png_structp png_ptr, png_bytep data, png_size_t length)
void png_flush (png_structp png_ptr)
void PNGAPI png_default_flush (png_structp png_ptr)
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)

Define Documentation

#define PNG_INTERNAL

Definition at line 18 of file pngwio.c.


Function Documentation

Definition at line 130 of file pngwio.c.

{
#if !defined(_WIN32_WCE)
   png_FILE_p io_ptr;
   io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
   if (io_ptr != NULL)
      fflush(io_ptr);
#endif
}

Definition at line 44 of file pngwio.c.

{
   png_uint_32 check;

#if defined(_WIN32_WCE)
   if ( !WriteFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
      check = 0;
#else
   check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
#endif
   if (check != length)
      png_error(png_ptr, "Write Error");
}

Here is the call graph for this function:

void png_flush ( png_structp  png_ptr)

Definition at line 122 of file pngwio.c.

{
   if (png_ptr->output_flush_fn != NULL)
      (*(png_ptr->output_flush_fn))(png_ptr);
}
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 
)

Definition at line 165 of file pngwio.c.

{
   png_ptr->io_ptr = io_ptr;

#if !defined(PNG_NO_STDIO)
   if (write_data_fn != NULL)
      png_ptr->write_data_fn = write_data_fn;
   else
      png_ptr->write_data_fn = png_default_write_data;
#else
   png_ptr->write_data_fn = write_data_fn;
#endif

#if defined(PNG_WRITE_FLUSH_SUPPORTED)
#if !defined(PNG_NO_STDIO)
   if (output_flush_fn != NULL)
      png_ptr->output_flush_fn = output_flush_fn;
   else
      png_ptr->output_flush_fn = png_default_flush;
#else
   png_ptr->output_flush_fn = output_flush_fn;
#endif
#endif /* PNG_WRITE_FLUSH_SUPPORTED */

   /* It is an error to read while writing a png file */
   if (png_ptr->read_data_fn != NULL)
   {
      png_ptr->read_data_fn = NULL;
      png_warning(png_ptr,
         "Attempted to set both read_data_fn and write_data_fn in");
      png_warning(png_ptr,
         "the same structure.  Resetting read_data_fn to NULL.");
   }
}

Here is the call graph for this function:

void png_write_data ( png_structp  png_ptr,
png_bytep  data,
png_size_t  length 
)

Definition at line 29 of file pngwio.c.

{
   if (png_ptr->write_data_fn != NULL )
      (*(png_ptr->write_data_fn))(png_ptr, data, length);
   else
      png_error(png_ptr, "Call to NULL write function");
}

Here is the call graph for this function: