diff options
author | Tor Andersson <tor@ghostscript.com> | 2005-06-02 11:34:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2005-06-02 11:34:46 +0200 |
commit | 4ad40244021880e90d670720ac4c3beeac70aebc (patch) | |
tree | 7bdf4abc06168d7da4b24998adc2e47ca9f70c84 /mupdf/pdf_open.c | |
parent | 987d58dfaf4030f43b2a8854e2d246f75465cc57 (diff) | |
download | mupdf-4ad40244021880e90d670720ac4c3beeac70aebc.tar.xz |
heh. forgot a bunch of files for the new stream stuff.
Diffstat (limited to 'mupdf/pdf_open.c')
-rw-r--r-- | mupdf/pdf_open.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mupdf/pdf_open.c b/mupdf/pdf_open.c index 67d9b5d9..fa1b214a 100644 --- a/mupdf/pdf_open.c +++ b/mupdf/pdf_open.c @@ -19,7 +19,7 @@ loadversion(pdf_xref *xref) n = fz_seek(xref->file, 0, 0); if (n < 0) - return fz_throw("ioerror: seek failed"); + return fz_ioerror(xref->file); fz_readline(xref->file, buf, sizeof buf); if (memcmp(buf, "%PDF-", 5) != 0) @@ -41,15 +41,15 @@ readstartxref(pdf_xref *xref) t = fz_seek(xref->file, 0, 2); if (t == -1) - return fz_throw("ioerror: seek failed"); + return fz_ioerror(xref->file); t = fz_seek(xref->file, MAX(0, t - ((int)sizeof buf)), 0); if (t == -1) - return fz_throw("ioerror: seek failed"); + return fz_ioerror(xref->file); n = fz_read(xref->file, buf, sizeof buf); if (n == -1) - return fz_throw("ioerror: read failed"); + return fz_ioerror(xref->file); for (i = n - 9; i >= 0; i--) { @@ -93,7 +93,7 @@ readoldtrailer(pdf_xref *xref, char *buf, int cap) n = fz_readline(xref->file, buf, cap); if (n < 0) - return fz_throw("ioerror: read failed"); + return fz_ioerror(xref->file); s = buf; ofs = atoi(strsep(&s, " ")); @@ -105,11 +105,11 @@ readoldtrailer(pdf_xref *xref, char *buf, int cap) t = fz_tell(xref->file); if (t < 0) - return fz_throw("ioerror: tell failed"); + return fz_ioerror(xref->file); n = fz_seek(xref->file, t + 20 * len, 0); if (n < 0) - return fz_throw("ioerror: seek failed"); + return fz_ioerror(xref->file); } t = pdf_lex(xref->file, buf, cap, &n); @@ -138,7 +138,7 @@ readtrailer(pdf_xref *xref, char *buf, int cap) n = fz_seek(xref->file, xref->startxref, 0); if (n < 0) - return fz_throw("ioerror: seek failed"); + return fz_ioerror(xref->file); c = fz_peekbyte(xref->file); if (c == 'x') @@ -177,7 +177,7 @@ readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap) n = fz_readline(xref->file, buf, cap); if (n < 0) - return fz_throw("ioerror: read failed"); + return fz_ioerror(xref->file); s = buf; ofs = atoi(strsep(&s, " ")); @@ -194,7 +194,7 @@ readoldxref(fz_obj **trailerp, pdf_xref *xref, char *buf, int cap) { n = fz_read(xref->file, buf, 20); if (n < 0) - return fz_throw("ioerror: read failed"); + return fz_ioerror(xref->file); if (n != 20) return fz_throw("syntaxerror: truncated xref table"); if (!xref->table[ofs + i].type) @@ -327,7 +327,7 @@ readxref(fz_obj **trailerp, pdf_xref *xref, int ofs, char *buf, int cap) n = fz_seek(xref->file, ofs, 0); if (n < 0) - return fz_throw("ioerror: seek failed"); + return fz_ioerror(xref->file); c = fz_peekbyte(xref->file); if (c == 'x') @@ -438,7 +438,7 @@ pdf_loadobjstm(pdf_xref *xref, int oid, int gen, char *buf, int cap) n = fz_seek(stm, first, 0); if (n < 0) { - error = fz_throw("ioerror: seek failed"); + error = fz_ioerror(stm); goto cleanupstm; } |