diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-04-15 14:10:33 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-04-26 15:13:08 +0100 |
commit | 26f4d19a9a575eb44a6fac44c3a991beee8b589d (patch) | |
tree | b9c9a8c42e794db77a3208dd99fce732beead280 /include/mupdf/fitz | |
parent | a2fc54fe202624b7f82662eb9ca04c718d886718 (diff) | |
download | mupdf-26f4d19a9a575eb44a6fac44c3a991beee8b589d.tar.xz |
Improve fz_new_document
Use a macro to make fz_new_document nicer (akin to
fz_malloc_struct).
Diffstat (limited to 'include/mupdf/fitz')
-rw-r--r-- | include/mupdf/fitz/document.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h index b70f7a8a..c3d96280 100644 --- a/include/mupdf/fitz/document.h +++ b/include/mupdf/fitz/document.h @@ -147,7 +147,9 @@ fz_document *fz_open_document_with_stream(fz_context *ctx, const char *magic, fz /* fz_new_document: Create and initialize a document struct. */ -void *fz_new_document(fz_context *ctx, int size); +void *fz_new_document_of_size(fz_context *ctx, int size); + +#define fz_new_document(C,M) ((M*)Memento_label(fz_new_document_of_size(ctx, sizeof(M)), #M)) /* fz_drop_document: Release an open document. |