* Include necessary headers...
*/
-#include <cups/raster-private.h>
+#include "raster-private.h"
/*
cups_raster_t *r, /* I - Raster stream */
cups_page_header_t *h) /* I - Pointer to header data */
{
- DEBUG_printf(("cupsRasterReadHeader(r=%p, h=%p)", (void *)r, (void *)h));
-
/*
* Get the raster header...
*/
if (!_cupsRasterReadHeader(r))
{
memset(h, 0, sizeof(cups_page_header_t));
- DEBUG_puts("1cupsRasterReadHeader: Unable to read page header, returning 0.");
return (0);
}
*/
memcpy(h, &(r->header), sizeof(cups_page_header_t));
-
- DEBUG_printf(("1cupsRasterReadHeader: cupsColorSpace=%s", _cupsRasterColorSpaceString(h->cupsColorSpace)));
- DEBUG_printf(("1cupsRasterReadHeader: cupsBitsPerColor=%u", h->cupsBitsPerColor));
- DEBUG_printf(("1cupsRasterReadHeader: cupsBitsPerPixel=%u", h->cupsBitsPerPixel));
- DEBUG_printf(("1cupsRasterReadHeader: cupsBytesPerLine=%u", h->cupsBytesPerLine));
- DEBUG_printf(("1cupsRasterReadHeader: cupsWidth=%u", h->cupsWidth));
- DEBUG_printf(("1cupsRasterReadHeader: cupsHeight=%u", h->cupsHeight));
-
- DEBUG_puts("1cupsRasterReadHeader: Returning 1.");
return (1);
}
* Get the raster header...
*/
- DEBUG_printf(("cupsRasterReadHeader2(r=%p, h=%p)", (void *)r, (void *)h));
-
if (!_cupsRasterReadHeader(r))
{
memset(h, 0, sizeof(cups_page_header2_t));
- DEBUG_puts("1cupsRasterReadHeader2: Unable to read header, returning 0.");
return (0);
}
*/
memcpy(h, &(r->header), sizeof(cups_page_header2_t));
-
- DEBUG_printf(("1cupsRasterReadHeader2: cupsColorSpace=%s", _cupsRasterColorSpaceString(h->cupsColorSpace)));
- DEBUG_printf(("1cupsRasterReadHeader2: cupsBitsPerColor=%u", h->cupsBitsPerColor));
- DEBUG_printf(("1cupsRasterReadHeader2: cupsBitsPerPixel=%u", h->cupsBitsPerPixel));
- DEBUG_printf(("1cupsRasterReadHeader2: cupsBytesPerLine=%u", h->cupsBytesPerLine));
- DEBUG_printf(("1cupsRasterReadHeader2: cupsWidth=%u", h->cupsWidth));
- DEBUG_printf(("1cupsRasterReadHeader2: cupsHeight=%u", h->cupsHeight));
-
- DEBUG_puts("1cupsRasterReadHeader2: Returning 1.");
return (1);
}
cups_raster_t *r, /* I - Raster stream */
cups_page_header_t *h) /* I - Raster page header */
{
- DEBUG_printf(("cupsRasterWriteHeader(r=%p, h=%p)", (void *)r, (void *)h));
-
if (r == NULL || r->mode == CUPS_RASTER_READ)
- {
- DEBUG_puts("1cupsRasterWriteHeader: Stream NULL or open for reading, returning 0.");
return (0);
- }
/*
* Make a copy of the header and write using the private function...
cups_raster_t *r, /* I - Raster stream */
cups_page_header2_t *h) /* I - Raster page header */
{
- DEBUG_printf(("cupsRasterWriteHeader(r=%p, h=%p)", (void *)r, (void *)h));
-
if (r == NULL || r->mode == CUPS_RASTER_READ)
- {
- DEBUG_puts("1cupsRasterWriteHeader2: Stream NULL or open for reading, returning 0.");
return (0);
- }
/*
* Make a copy of the header, and compute the number of raster
while ((count = read(fd, buf, bytes)) < 0)
#endif /* _WIN32 */
if (errno != EINTR && errno != EAGAIN)
- {
- DEBUG_printf(("8cups_read_fd: %s", strerror(errno)));
return (-1);
- }
-
- DEBUG_printf(("8cups_read_fd: Returning %d bytes.", (int)count));
return (count);
}
while ((count = write(fd, buf, bytes)) < 0)
#endif /* _WIN32 */
if (errno != EINTR && errno != EAGAIN)
- {
- DEBUG_printf(("8cups_write_fd: %s", strerror(errno)));
return (-1);
- }
return (count);
}