From 37f95f87bdfb2e0b01d649afae5fffe60bf99d3a Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 11 Nov 2016 16:05:30 +0000 Subject: Make fz_buffer structure private to fitz. Move the definition of the structure contents into new fitz-imp.h file. Make all code outside of fitz access the buffer through the defined API. Add a convenience API for people that want to get buffers as null terminated C strings. --- source/svg/svg-doc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/svg') diff --git a/source/svg/svg-doc.c b/source/svg/svg-doc.c index 5f7f809b..d0ff1e4a 100644 --- a/source/svg/svg-doc.c +++ b/source/svg/svg-doc.c @@ -88,8 +88,11 @@ svg_open_document_with_buffer(fz_context *ctx, fz_buffer *buf) { svg_document *doc; fz_xml *root; + size_t len; + unsigned char *data; - root = fz_parse_xml(ctx, buf->data, buf->len, 0); + len = fz_buffer_storage(ctx, buf, &data); + root = fz_parse_xml(ctx, data, len, 0); doc = fz_new_document(ctx, svg_document); doc->super.drop_document = svg_drop_document; -- cgit v1.2.3