summaryrefslogtreecommitdiff
path: root/source/cbz/mucbz.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2015-04-14 11:53:53 +0200
committerRobin Watts <robin.watts@artifex.com>2015-04-14 16:13:58 +0100
commita7be4a1caca767baa0ce0946792f3c3e9e150308 (patch)
tree76804ec000992a20fdf62bf962ef06df6750a0e8 /source/cbz/mucbz.c
parent1bc74dac2b251764d373c164e2b5235875f27901 (diff)
downloadmupdf-a7be4a1caca767baa0ce0946792f3c3e9e150308.tar.xz
Split fz_meta into separate querying functions.
Add fz_has_permission function to fz_document. Add fz_lookup_metadata function to fz_document. Remove fz_meta function from fz_document.
Diffstat (limited to 'source/cbz/mucbz.c')
-rw-r--r--source/cbz/mucbz.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/cbz/mucbz.c b/source/cbz/mucbz.c
index c85cca45..14be8333 100644
--- a/source/cbz/mucbz.c
+++ b/source/cbz/mucbz.c
@@ -187,16 +187,11 @@ cbz_load_page(fz_context *ctx, cbz_document *doc, int number)
}
static int
-cbz_meta(fz_context *ctx, cbz_document *doc, int key, void *ptr, int size)
+cbz_lookup_metadata(fz_context *ctx, cbz_document *doc, const char *key, char *buf, int size)
{
- switch (key)
- {
- case FZ_META_FORMAT_INFO:
- sprintf((char *)ptr, "CBZ");
- return FZ_META_OK;
- default:
- return FZ_META_UNKNOWN_KEY;
- }
+ if (!strcmp(key, "format"))
+ return fz_strlcpy(buf, "CBZ", size);
+ return -1;
}
static cbz_document *
@@ -207,7 +202,7 @@ cbz_open_document_with_stream(fz_context *ctx, fz_stream *file)
doc->super.close = (fz_document_close_fn *)cbz_close_document;
doc->super.count_pages = (fz_document_count_pages_fn *)cbz_count_pages;
doc->super.load_page = (fz_document_load_page_fn *)cbz_load_page;
- doc->super.meta = (fz_document_meta_fn *)cbz_meta;
+ doc->super.lookup_metadata = (fz_document_lookup_metadata_fn *)cbz_lookup_metadata;
fz_try(ctx)
{