summaryrefslogtreecommitdiff
path: root/xps/muxps.h
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-10-04 18:44:19 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-10-04 18:44:19 +0100
commitd208be26537db558edb70236ae517cea31b7ebab (patch)
tree57da95b97e354a53bd4517a42010e90968f007d9 /xps/muxps.h
parentba46cad4b09bb957085900a203206c8fa5868cd4 (diff)
downloadmupdf-d208be26537db558edb70236ae517cea31b7ebab.tar.xz
Move to exception handling rather than error passing throughout.
This frees us from passing errors back everywhere, and hence enables us to pass results back as return values. Rather than having to explicitly check for errors everywhere and bubble them, we now allow exception handling to do the work for us; the downside to this is that we no longer emit as much debugging information as we did before (though this could be put back in). For now, the debugging information we have lost has been retained in comments with 'RJW:' at the start. This code needs fuller testing, but is being committed as a work in progress.
Diffstat (limited to 'xps/muxps.h')
-rw-r--r--xps/muxps.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/xps/muxps.h b/xps/muxps.h
index 36635331..48ad2ae0 100644
--- a/xps/muxps.h
+++ b/xps/muxps.h
@@ -91,16 +91,16 @@ void xps_debug_page_list(xps_document *doc);
void xps_free_page_list(xps_document *doc);
int xps_count_pages(xps_document *doc);
-int xps_load_page(xps_page **page, xps_document *doc, int number);
+xps_page *xps_load_page(xps_document *doc, int number);
void xps_free_page(xps_document *doc, xps_page *page);
/*
* Images, fonts, and colorspaces.
*/
-int xps_decode_jpeg(fz_context *doc, fz_pixmap **imagep, byte *rbuf, int rlen);
-int xps_decode_png(fz_context *doc, fz_pixmap **imagep, byte *rbuf, int rlen);
-int xps_decode_tiff(fz_context *doc, fz_pixmap **imagep, byte *rbuf, int rlen);
+fz_pixmap *xps_decode_jpeg(fz_context *doc, byte *rbuf, int rlen);
+fz_pixmap *xps_decode_png(fz_context *doc, byte *rbuf, int rlen);
+fz_pixmap *xps_decode_tiff(fz_context *doc, byte *rbuf, int rlen);
typedef struct xps_font_cache_s xps_font_cache;
@@ -227,8 +227,8 @@ struct xps_document_s
fz_device *dev;
};
-int xps_open_file(fz_context *doc, xps_document **ctxp, char *filename);
-int xps_open_stream(xps_document **ctxp, fz_stream *file);
+xps_document *xps_open_file(fz_context *ctx, char *filename);
+xps_document *xps_open_stream(fz_stream *file);
void xps_free_context(xps_document *doc);
#endif