summaryrefslogtreecommitdiff
path: root/pdf/mupdf.h
diff options
context:
space:
mode:
Diffstat (limited to 'pdf/mupdf.h')
-rw-r--r--pdf/mupdf.h72
1 files changed, 36 insertions, 36 deletions
diff --git a/pdf/mupdf.h b/pdf/mupdf.h
index 779fb976..727d28e2 100644
--- a/pdf/mupdf.h
+++ b/pdf/mupdf.h
@@ -25,12 +25,12 @@ enum
PDF_NUM_TOKENS
};
-fz_error pdf_lex(int *tok, fz_stream *f, char *buf, int n, int *len);
+int pdf_lex(fz_stream *f, char *buf, int n, int *len);
-fz_error pdf_parse_array(fz_obj **op, pdf_xref *xref, fz_stream *f, char *buf, int cap);
-fz_error pdf_parse_dict(fz_obj **op, pdf_xref *xref, fz_stream *f, char *buf, int cap);
-fz_error pdf_parse_stm_obj(fz_obj **op, pdf_xref *xref, fz_stream *f, char *buf, int cap);
-fz_error pdf_parse_ind_obj(fz_obj **op, pdf_xref *xref, fz_stream *f, char *buf, int cap, int *num, int *gen, int *stm_ofs);
+fz_obj *pdf_parse_array(pdf_xref *xref, fz_stream *f, char *buf, int cap);
+fz_obj *pdf_parse_dict(pdf_xref *xref, fz_stream *f, char *buf, int cap);
+fz_obj *pdf_parse_stm_obj(pdf_xref *xref, fz_stream *f, char *buf, int cap);
+fz_obj * pdf_parse_ind_obj(pdf_xref *xref, fz_stream *f, char *buf, int cap, int *num, int *gen, int *stm_ofs);
fz_rect pdf_to_rect(fz_context *ctx, fz_obj *array);
fz_matrix pdf_to_matrix(fz_context *ctx, fz_obj *array);
@@ -79,25 +79,25 @@ struct pdf_xref_s
};
fz_obj *pdf_resolve_indirect(fz_obj *ref);
-fz_error pdf_cache_object(pdf_xref *, int num, int gen);
-fz_error pdf_load_object(fz_obj **objp, pdf_xref *, int num, int gen);
+void pdf_cache_object(pdf_xref *, int num, int gen);
+fz_obj *pdf_load_object(pdf_xref *, int num, int gen);
void pdf_update_object( pdf_xref *xref, int num, int gen, fz_obj *newobj);
int pdf_is_stream(pdf_xref *xref, int num, int gen);
fz_stream *pdf_open_inline_stream(fz_stream *chain, pdf_xref *xref, fz_obj *stmobj, int length);
-fz_error pdf_load_raw_stream(fz_buffer **bufp, pdf_xref *xref, int num, int gen);
-fz_error pdf_load_stream(fz_buffer **bufp, pdf_xref *xref, int num, int gen);
-fz_error pdf_open_raw_stream(fz_stream **stmp, pdf_xref *, int num, int gen);
-fz_error pdf_open_stream(fz_stream **stmp, pdf_xref *, int num, int gen);
-fz_error pdf_open_stream_at(fz_stream **stmp, pdf_xref *xref, int num, int gen, fz_obj *dict, int stm_ofs);
-
-fz_error pdf_open_xref_with_stream(pdf_xref **xrefp, fz_stream *file, char *password);
-fz_error pdf_open_xref(fz_context *ctx, pdf_xref **xrefp, const char *filename, char *password);
+fz_buffer *pdf_load_raw_stream(pdf_xref *xref, int num, int gen);
+fz_buffer *pdf_load_stream(pdf_xref *xref, int num, int gen);
+fz_stream *pdf_open_raw_stream(pdf_xref *, int num, int gen);
+fz_stream *pdf_open_stream(pdf_xref *, int num, int gen);
+fz_stream *pdf_open_stream_at(pdf_xref *xref, int num, int gen, fz_obj *dict, int stm_ofs);
+
+pdf_xref *pdf_open_xref_with_stream(fz_stream *file, char *password);
+pdf_xref *pdf_open_xref(fz_context *ctx, const char *filename, char *password);
void pdf_free_xref(pdf_xref *);
/* private */
-fz_error pdf_repair_xref(pdf_xref *xref, char *buf, int bufsize);
-fz_error pdf_repair_obj_stms(pdf_xref *xref);
+void pdf_repair_xref(pdf_xref *xref, char *buf, int bufsize);
+void pdf_repair_obj_stms(pdf_xref *xref);
void pdf_debug_xref(pdf_xref *);
void pdf_resize_xref(pdf_xref *xref, int newcap);
@@ -118,7 +118,7 @@ enum
PDF_DEFAULT_PERM_FLAGS = 0xfffc
};
-fz_error pdf_new_crypt(fz_context *ctx, pdf_crypt **cp, fz_obj *enc, fz_obj *id);
+pdf_crypt *pdf_new_crypt(fz_context *ctx, fz_obj *enc, fz_obj *id);
void pdf_free_crypt(fz_context *ctx, pdf_crypt *crypt);
void pdf_crypt_obj(fz_context *ctx, pdf_crypt *crypt, fz_obj *obj, int num, int gen);
@@ -160,18 +160,18 @@ void pdf_age_store(fz_context *ctx, pdf_store *store, int maxage);
typedef struct pdf_function_s pdf_function;
-fz_error pdf_load_function(pdf_function **func, pdf_xref *xref, fz_obj *ref);
+pdf_function *pdf_load_function(pdf_xref *xref, fz_obj *ref);
void pdf_eval_function(fz_context *ctx, pdf_function *func, float *in, int inlen, float *out, int outlen);
pdf_function *pdf_keep_function(pdf_function *func);
void pdf_drop_function(fz_context *ctx, pdf_function *func);
-fz_error pdf_load_colorspace(fz_colorspace **csp, pdf_xref *xref, fz_obj *obj);
+fz_colorspace *pdf_load_colorspace(pdf_xref *xref, fz_obj *obj);
fz_pixmap *pdf_expand_indexed_pixmap(fz_context *ctx, fz_pixmap *src);
-fz_error pdf_load_shading(fz_shade **shadep, pdf_xref *xref, fz_obj *obj);
+fz_shade *pdf_load_shading(pdf_xref *xref, fz_obj *obj);
-fz_error pdf_load_inline_image(fz_pixmap **imgp, pdf_xref *xref, fz_obj *rdb, fz_obj *dict, fz_stream *file);
-fz_error pdf_load_image(fz_pixmap **imgp, pdf_xref *xref, fz_obj *obj);
+fz_pixmap *pdf_load_inline_image(pdf_xref *xref, fz_obj *rdb, fz_obj *dict, fz_stream *file);
+fz_pixmap *pdf_load_image(pdf_xref *xref, fz_obj *obj);
int pdf_is_jpx_image(fz_context *ctx, fz_obj *dict);
/*
@@ -192,7 +192,7 @@ struct pdf_pattern_s
fz_buffer *contents;
};
-fz_error pdf_load_pattern(pdf_pattern **patp, pdf_xref *xref, fz_obj *obj);
+pdf_pattern *pdf_load_pattern(pdf_xref *xref, fz_obj *obj);
pdf_pattern *pdf_keep_pattern(pdf_pattern *pat);
void pdf_drop_pattern(fz_context *ctx, pdf_pattern *pat);
@@ -215,7 +215,7 @@ struct pdf_xobject_s
fz_buffer *contents;
};
-fz_error pdf_load_xobject(pdf_xobject **xobjp, pdf_xref *xref, fz_obj *obj);
+pdf_xobject *pdf_load_xobject(pdf_xref *xref, fz_obj *obj);
pdf_xobject *pdf_keep_xobject(pdf_xobject *xobj);
void pdf_drop_xobject(fz_context *ctx, pdf_xobject *xobj);
@@ -283,9 +283,9 @@ int pdf_lookup_cmap_full(pdf_cmap *cmap, int cpt, int *out);
unsigned char *pdf_decode_cmap(pdf_cmap *cmap, unsigned char *s, int *cpt);
pdf_cmap *pdf_new_identity_cmap(fz_context *ctx, int wmode, int bytes);
-fz_error pdf_parse_cmap(pdf_cmap **cmapp, fz_stream *file);
-fz_error pdf_load_embedded_cmap(pdf_cmap **cmapp, pdf_xref *xref, fz_obj *ref);
-fz_error pdf_load_system_cmap(fz_context *ctx, pdf_cmap **cmapp, char *name);
+pdf_cmap *pdf_parse_cmap(fz_stream *file);
+pdf_cmap *pdf_load_embedded_cmap(pdf_xref *xref, fz_obj *ref);
+pdf_cmap *pdf_load_system_cmap(fz_context *ctx, char *name);
pdf_cmap *pdf_find_builtin_cmap(char *cmap_name);
/*
@@ -387,7 +387,7 @@ void pdf_end_vmtx(pdf_font_desc *font);
pdf_hmtx pdf_get_hmtx(pdf_font_desc *font, int cid);
pdf_vmtx pdf_get_vmtx(pdf_font_desc *font, int cid);
-fz_error pdf_load_to_unicode(pdf_font_desc *font, pdf_xref *xref, char **strings, char *collection, fz_obj *cmapstm);
+void pdf_load_to_unicode(pdf_font_desc *font, pdf_xref *xref, char **strings, char *collection, fz_obj *cmapstm);
int pdf_font_cid_to_gid(pdf_font_desc *fontdesc, int cid);
@@ -395,8 +395,8 @@ unsigned char *pdf_find_builtin_font(char *name, unsigned int *len);
unsigned char *pdf_find_substitute_font(int mono, int serif, int bold, int italic, unsigned int *len);
unsigned char *pdf_find_substitute_cjk_font(int ros, int serif, unsigned int *len);
-fz_error pdf_load_type3_font(pdf_font_desc **fontp, pdf_xref *xref, fz_obj *rdb, fz_obj *obj);
-fz_error pdf_load_font(pdf_font_desc **fontp, pdf_xref *xref, fz_obj *rdb, fz_obj *obj);
+pdf_font_desc *pdf_load_type3_font(pdf_xref *xref, fz_obj *rdb, fz_obj *obj);
+pdf_font_desc *pdf_load_font(pdf_xref *xref, fz_obj *rdb, fz_obj *obj);
pdf_font_desc *pdf_new_font_desc(fz_context *ctx);
pdf_font_desc *pdf_keep_font(pdf_font_desc *fontdesc);
@@ -479,19 +479,19 @@ struct pdf_page_s
pdf_annot *annots;
};
-fz_error pdf_load_page_tree(pdf_xref *xref);
+void pdf_load_page_tree(pdf_xref *xref);
int pdf_find_page_number(pdf_xref *xref, fz_obj *pageobj);
int pdf_count_pages(pdf_xref *xref);
-fz_error pdf_load_page(pdf_page **pagep, pdf_xref *xref, int number);
+pdf_page *pdf_load_page(pdf_xref *xref, int number);
void pdf_free_page(fz_context *ctx, pdf_page *page);
/*
* Content stream parsing
*/
-fz_error pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, char *target);
-fz_error pdf_run_page(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm);
-fz_error pdf_run_glyph(pdf_xref *xref, fz_obj *resources, fz_buffer *contents, fz_device *dev, fz_matrix ctm);
+void pdf_run_page_with_usage(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm, char *target);
+void pdf_run_page(pdf_xref *xref, pdf_page *page, fz_device *dev, fz_matrix ctm);
+void pdf_run_glyph(pdf_xref *xref, fz_obj *resources, fz_buffer *contents, fz_device *dev, fz_matrix ctm);
#endif