diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-01-21 16:42:45 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-02-17 18:05:39 +0100 |
commit | f84a189d5f94250e46d2cbd1a75aba00130e2dd6 (patch) | |
tree | 8ee614ab90de1baa8941f91ae4946ed5c2e70721 /source/pdf/pdf-store.c | |
parent | 681039767f2ccc72e236246178893eb0989169c9 (diff) | |
download | mupdf-f84a189d5f94250e46d2cbd1a75aba00130e2dd6.tar.xz |
Add ctx parameter and remove embedded contexts for API regularity.
Purge several embedded contexts:
Remove embedded context in fz_output.
Remove embedded context in fz_stream.
Remove embedded context in fz_device.
Remove fz_rebind_stream (since it is no longer necessary).
Remove embedded context in svg_device.
Remove embedded context in XML parser.
Add ctx argument to fz_document functions.
Remove embedded context in fz_document.
Remove embedded context in pdf_document.
Remove embedded context in pdf_obj.
Make fz_page independent of fz_document in the interface.
We shouldn't need to pass the document to all functions handling a page.
If a page is tied to the source document, it's redundant; otherwise it's
just pointless.
Fix reference counting oddity in fz_new_image_from_pixmap.
Diffstat (limited to 'source/pdf/pdf-store.c')
-rw-r--r-- | source/pdf/pdf-store.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/pdf/pdf-store.c b/source/pdf/pdf-store.c index 7349e9d4..51255414 100644 --- a/source/pdf/pdf-store.c +++ b/source/pdf/pdf-store.c @@ -1,48 +1,48 @@ #include "mupdf/pdf.h" static int -pdf_make_hash_key(fz_store_hash *hash, void *key_) +pdf_make_hash_key(fz_context *ctx, fz_store_hash *hash, void *key_) { pdf_obj *key = (pdf_obj *)key_; - if (!pdf_is_indirect(key)) + if (!pdf_is_indirect(ctx, key)) return 0; - hash->u.i.i0 = pdf_to_num(key); - hash->u.i.i1 = pdf_to_gen(key); - hash->u.i.ptr = pdf_get_indirect_document(key); + hash->u.i.i0 = pdf_to_num(ctx, key); + hash->u.i.i1 = pdf_to_gen(ctx, key); + hash->u.i.ptr = pdf_get_indirect_document(ctx, key); return 1; } static void * pdf_keep_key(fz_context *ctx, void *key) { - return (void *)pdf_keep_obj((pdf_obj *)key); + return (void *)pdf_keep_obj(ctx, (pdf_obj *)key); } static void pdf_drop_key(fz_context *ctx, void *key) { - pdf_drop_obj((pdf_obj *)key); + pdf_drop_obj(ctx, (pdf_obj *)key); } static int -pdf_cmp_key(void *k0, void *k1) +pdf_cmp_key(fz_context *ctx, void *k0, void *k1) { - return pdf_objcmp((pdf_obj *)k0, (pdf_obj *)k1); + return pdf_objcmp(ctx, (pdf_obj *)k0, (pdf_obj *)k1); } #ifndef NDEBUG static void -pdf_debug_key(FILE *out, void *key_) +pdf_debug_key(fz_context *ctx, FILE *out, void *key_) { pdf_obj *key = (pdf_obj *)key_; - if (pdf_is_indirect(key)) + if (pdf_is_indirect(ctx, key)) { - fprintf(out, "(%d %d R) ", pdf_to_num(key), pdf_to_gen(key)); + fprintf(out, "(%d %d R) ", pdf_to_num(ctx, key), pdf_to_gen(ctx, key)); } else - pdf_fprint_obj(out, key, 0); + pdf_fprint_obj(ctx, out, key, 0); } #endif |