summaryrefslogtreecommitdiff
path: root/source/xps
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/xps
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/xps')
-rw-r--r--source/xps/xps-zip.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/source/xps/xps-zip.c b/source/xps/xps-zip.c
index 3759c4b6..0580378b 100644
--- a/source/xps/xps-zip.c
+++ b/source/xps/xps-zip.c
@@ -221,16 +221,11 @@ xps_close_document(fz_context *ctx, xps_document *doc)
}
static int
-xps_meta(fz_context *ctx, xps_document *doc, int key, void *ptr, int size)
+xps_lookup_metadata(fz_context *ctx, xps_document *doc, const char *key, char *buf, int size)
{
- switch (key)
- {
- case FZ_META_FORMAT_INFO:
- sprintf((char *)ptr, "XPS");
- return FZ_META_OK;
- default:
- return FZ_META_UNKNOWN_KEY;
- }
+ if (!strcmp(key, "format"))
+ return fz_strlcpy(buf, "XPS", size);
+ return -1;
}
static void
@@ -241,5 +236,5 @@ xps_init_document(fz_context *ctx, xps_document *doc)
doc->super.load_outline = (fz_document_load_outline_fn *)xps_load_outline;
doc->super.count_pages = (fz_document_count_pages_fn *)xps_count_pages;
doc->super.load_page = (fz_document_load_page_fn *)xps_load_page;
- doc->super.meta = (fz_document_meta_fn *)xps_meta;
+ doc->super.lookup_metadata = (fz_document_lookup_metadata_fn *)xps_lookup_metadata;
}