From d208be26537db558edb70236ae517cea31b7ebab Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Tue, 4 Oct 2011 18:44:19 +0100 Subject: 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. --- xps/muxps.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'xps/muxps.h') 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 -- cgit v1.2.3