summaryrefslogtreecommitdiffstats
path: root/include/qpdf/qpdf-c.h
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2011-08-11 17:56:37 +0200
committerJay Berkenbilt <ejb@ql.org>2011-08-11 17:57:37 +0200
commit76b1659177327a64037bf36d7f3e15a73d86bbed (patch)
tree22623001bb99a6fe33943416877a3d5836b550d8 /include/qpdf/qpdf-c.h
parent14fe2e6de3ae3b91436ccb4948fca75c29565440 (diff)
downloadqpdf-76b1659177327a64037bf36d7f3e15a73d86bbed.tar.zst
enhance PointerHolder so that it can explicitly be told to use delete [] instead of delete, thus making it useful to run valgrind over qpdf during its test suite
Diffstat (limited to 'include/qpdf/qpdf-c.h')
-rw-r--r--include/qpdf/qpdf-c.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/qpdf/qpdf-c.h b/include/qpdf/qpdf-c.h
index 98a6f07b..168da154 100644
--- a/include/qpdf/qpdf-c.h
+++ b/include/qpdf/qpdf-c.h
@@ -285,6 +285,25 @@ extern "C" {
QPDF_DLL
QPDF_ERROR_CODE qpdf_init_write(qpdf_data qpdf, char const* filename);
+ /* Initialize for writing but indicate that the PDF file should be
+ * written to memory. Call qpdf_get_buffer_length and
+ * qpdf_get_buffer to retrieve the resulting buffer. The memory
+ * containing the PDF file will be destroyed when qpdf_cleanup is
+ * called.
+ */
+ QPDF_DLL
+ QPDF_ERROR_CODE qpdf_init_write_memory(qpdf_data qpdf);
+
+ /* Retrieve the buffer used if the file was written to memory.
+ * qpdf_get_buffer returns a null pointer if data was not written
+ * to memory. The memory is freed when qpdf_cleanup is called or
+ * if a subsequent call to qpdf_init_write or
+ * qpdf_init_write_memory is called. */
+ QPDF_DLL
+ unsigned long qpdf_get_buffer_length(qpdf_data qpdf);
+ QPDF_DLL
+ unsigned char const* qpdf_get_buffer(qpdf_data qpdf);
+
QPDF_DLL
void qpdf_set_object_stream_mode(qpdf_data qpdf,
enum qpdf_object_stream_e mode);