summaryrefslogtreecommitdiff
path: root/source/fitz/store.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-01-21 16:42:45 +0100
committerTor Andersson <tor.andersson@artifex.com>2015-02-17 18:05:39 +0100
commitf84a189d5f94250e46d2cbd1a75aba00130e2dd6 (patch)
tree8ee614ab90de1baa8941f91ae4946ed5c2e70721 /source/fitz/store.c
parent681039767f2ccc72e236246178893eb0989169c9 (diff)
downloadmupdf-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/fitz/store.c')
-rw-r--r--source/fitz/store.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/fitz/store.c b/source/fitz/store.c
index 315f8e81..d4cafe15 100644
--- a/source/fitz/store.c
+++ b/source/fitz/store.c
@@ -114,7 +114,7 @@ evict(fz_context *ctx, fz_item *item)
{
fz_store_hash hash = { NULL };
hash.drop = item->val->drop;
- if (item->type->make_hash_key(&hash, item->key))
+ if (item->type->make_hash_key(ctx, &hash, item->key))
fz_hash_remove(ctx, store->hash, &hash);
}
fz_unlock(ctx, FZ_LOCK_ALLOC);
@@ -251,7 +251,7 @@ fz_store_item(fz_context *ctx, void *key, void *val_, unsigned int itemsize, fz_
if (type->make_hash_key)
{
hash.drop = val->drop;
- use_hash = type->make_hash_key(&hash, key);
+ use_hash = type->make_hash_key(ctx, &hash, key);
}
type->keep_key(ctx, key);
@@ -363,7 +363,7 @@ fz_find_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type *
if (type->make_hash_key)
{
hash.drop = drop;
- use_hash = type->make_hash_key(&hash, key);
+ use_hash = type->make_hash_key(ctx, &hash, key);
}
fz_lock(ctx, FZ_LOCK_ALLOC);
@@ -377,7 +377,7 @@ fz_find_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type *
/* Others we have to hunt for slowly */
for (item = store->head; item; item = item->next)
{
- if (item->val->drop == drop && !type->cmp_key(item->key, key))
+ if (item->val->drop == drop && !type->cmp_key(ctx, item->key, key))
break;
}
}
@@ -411,7 +411,7 @@ fz_remove_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type
if (type->make_hash_key)
{
hash.drop = drop;
- use_hash = type->make_hash_key(&hash, key);
+ use_hash = type->make_hash_key(ctx, &hash, key);
}
fz_lock(ctx, FZ_LOCK_ALLOC);
@@ -426,7 +426,7 @@ fz_remove_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type
{
/* Others we have to hunt for slowly */
for (item = store->head; item; item = item->next)
- if (item->val->drop == drop && !type->cmp_key(item->key, key))
+ if (item->val->drop == drop && !type->cmp_key(ctx, item->key, key))
break;
}
if (item)
@@ -527,7 +527,7 @@ fz_print_store_locked(fz_context *ctx, FILE *out)
next->val->refs++;
fprintf(out, "store[*][refs=%d][size=%d] ", item->val->refs, item->size);
fz_unlock(ctx, FZ_LOCK_ALLOC);
- item->type->debug(out, item->key);
+ item->type->debug(ctx, out, item->key);
fprintf(out, " = %p\n", item->val);
fflush(out);
fz_lock(ctx, FZ_LOCK_ALLOC);