diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2015-01-20 16:42:29 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2015-02-17 16:36:10 +0100 |
commit | 681039767f2ccc72e236246178893eb0989169c9 (patch) | |
tree | 2eccad54c5b5bc964335dc97fe5b0fec8449d16e /source/fitz/store.c | |
parent | 76a09166ddbe5b741f54f0fd203f2135e5b532c3 (diff) | |
download | mupdf-681039767f2ccc72e236246178893eb0989169c9.tar.xz |
Rename fz_close_* and fz_free_* to fz_drop_*.
Rename fz_close to fz_drop_stream.
Rename fz_close_archive to fz_drop_archive.
Rename fz_close_output to fz_drop_output.
Rename fz_free_* to fz_drop_*.
Rename pdf_free_* to pdf_drop_*.
Rename xps_free_* to xps_drop_*.
Diffstat (limited to 'source/fitz/store.c')
-rw-r--r-- | source/fitz/store.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source/fitz/store.c b/source/fitz/store.c index cf0e3536..315f8e81 100644 --- a/source/fitz/store.c +++ b/source/fitz/store.c @@ -88,7 +88,7 @@ fz_drop_storable(fz_context *ctx, fz_storable *s) } fz_unlock(ctx, FZ_LOCK_ALLOC); if (do_free) - s->free(ctx, s); + s->drop(ctx, s); } static void @@ -113,14 +113,14 @@ evict(fz_context *ctx, fz_item *item) if (item->type->make_hash_key) { fz_store_hash hash = { NULL }; - hash.free = item->val->free; + hash.drop = item->val->drop; if (item->type->make_hash_key(&hash, item->key)) fz_hash_remove(ctx, store->hash, &hash); } fz_unlock(ctx, FZ_LOCK_ALLOC); if (drop) - item->val->free(ctx, item->val); - /* Always drops the key and free the item */ + item->val->drop(ctx, item->val); + /* Always drops the key and drop the item */ item->type->drop_key(ctx, item->key); fz_free(ctx, item); fz_lock(ctx, FZ_LOCK_ALLOC); @@ -250,7 +250,7 @@ fz_store_item(fz_context *ctx, void *key, void *val_, unsigned int itemsize, fz_ if (type->make_hash_key) { - hash.free = val->free; + hash.drop = val->drop; use_hash = type->make_hash_key(&hash, key); } @@ -347,7 +347,7 @@ fz_store_item(fz_context *ctx, void *key, void *val_, unsigned int itemsize, fz_ } void * -fz_find_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type *type) +fz_find_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type *type) { fz_item *item; fz_store *store = ctx->store; @@ -362,7 +362,7 @@ fz_find_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type * if (type->make_hash_key) { - hash.free = free; + hash.drop = drop; use_hash = type->make_hash_key(&hash, key); } @@ -377,7 +377,7 @@ fz_find_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type * /* Others we have to hunt for slowly */ for (item = store->head; item; item = item->next) { - if (item->val->free == free && !type->cmp_key(item->key, key)) + if (item->val->drop == drop && !type->cmp_key(item->key, key)) break; } } @@ -400,17 +400,17 @@ fz_find_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type * } void -fz_remove_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type *type) +fz_remove_item(fz_context *ctx, fz_store_drop_fn *drop, void *key, fz_store_type *type) { fz_item *item; fz_store *store = ctx->store; - int drop; + int dodrop; fz_store_hash hash = { NULL }; int use_hash = 0; if (type->make_hash_key) { - hash.free = free; + hash.drop = drop; use_hash = type->make_hash_key(&hash, key); } @@ -426,7 +426,7 @@ fz_remove_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type { /* Others we have to hunt for slowly */ for (item = store->head; item; item = item->next) - if (item->val->free == free && !type->cmp_key(item->key, key)) + if (item->val->drop == drop && !type->cmp_key(item->key, key)) break; } if (item) @@ -445,10 +445,10 @@ fz_remove_item(fz_context *ctx, fz_store_free_fn *free, void *key, fz_store_type else store->head = item->next; } - drop = (item->val->refs > 0 && --item->val->refs == 0); + dodrop = (item->val->refs > 0 && --item->val->refs == 0); fz_unlock(ctx, FZ_LOCK_ALLOC); - if (drop) - item->val->free(ctx, item->val); + if (dodrop) + item->val->drop(ctx, item->val); type->drop_key(ctx, item->key); fz_free(ctx, item); } @@ -497,7 +497,7 @@ fz_drop_store_context(fz_context *ctx) return; fz_empty_store(ctx); - fz_free_hash(ctx, ctx->store->hash); + fz_drop_hash(ctx, ctx->store->hash); fz_free(ctx, ctx->store); ctx->store = NULL; } |