diff options
Diffstat (limited to 'base/gstiffio.c')
-rw-r--r-- | base/gstiffio.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/base/gstiffio.c b/base/gstiffio.c index 1dbc9812c..e69ad145e 100644 --- a/base/gstiffio.c +++ b/base/gstiffio.c @@ -37,7 +37,7 @@ static const char tifs_msg_truncated[] = "\n*** Previous line has been truncated /* place to hold the data for our libtiff i/o hooks */ typedef struct tifs_io_private_t { - FILE *f; + gp_file *f; gx_device_printer *pdev; } tifs_io_private; @@ -68,7 +68,7 @@ gs_tifsReadProc(thandle_t fd, void* buf, size_t size) if ((size_t) size_io != size) { return (size_t) -1; } - return((size_t) fread (buf, 1, size_io, tiffio->f)); + return((size_t) gp_fread (buf, 1, size_io, tiffio->f)); } static size_t @@ -81,7 +81,7 @@ gs_tifsWriteProc(thandle_t fd, void* buf, size_t size) if ((size_t) size_io != size) { return (size_t) -1; } - written = (size_t) fwrite (buf, 1, size_io, tiffio->f); + written = (size_t) gp_fwrite (buf, 1, size_io, tiffio->f); return written; } @@ -94,10 +94,10 @@ gs_tifsSeekProc(thandle_t fd, uint64_t off, int whence) if ((uint64_t) off_io != off) { return (uint64_t) -1; /* this is really gross */ } - if (gp_fseek_64(tiffio->f , (gs_offset_t)off_io, whence) < 0) { + if (gp_fseek(tiffio->f , (gs_offset_t)off_io, whence) < 0) { return (uint64_t) -1; } - return (gp_ftell_64(tiffio->f)); + return (gp_ftell(tiffio->f)); } static int @@ -105,7 +105,7 @@ gs_tifsCloseProc(thandle_t fd) { tifs_io_private *tiffio = (tifs_io_private *)fd; gx_device_printer *pdev = tiffio->pdev; - int code = fclose(tiffio->f); + int code = gp_fclose(tiffio->f); gs_free(pdev->memory, tiffio, sizeof(tifs_io_private), 1, "gs_tifsCloseProc"); @@ -117,25 +117,25 @@ gs_tifsSizeProc(thandle_t fd) { tifs_io_private *tiffio = (tifs_io_private *)fd; uint64_t length; - gs_offset_t curpos = gp_ftell_64(tiffio->f); + gs_offset_t curpos = gp_ftell(tiffio->f); if (curpos < 0) { return(0); } - if (gp_fseek_64(tiffio->f, (gs_offset_t)0, SEEK_END) < 0) { + if (gp_fseek(tiffio->f, (gs_offset_t)0, SEEK_END) < 0) { return(0); } - length = (uint64_t)gp_ftell_64(tiffio->f); + length = (uint64_t)gp_ftell(tiffio->f); - if (gp_fseek_64(tiffio->f, curpos, SEEK_SET) < 0) { + if (gp_fseek(tiffio->f, curpos, SEEK_SET) < 0) { return(0); } return length; } TIFF * -tiff_from_filep(gx_device_printer *dev, const char *name, FILE *filep, int big_endian, bool usebigtiff) +tiff_from_filep(gx_device_printer *dev, const char *name, gp_file *filep, int big_endian, bool usebigtiff) { char mode[5] = "w"; int modelen = 1; |