aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-12-17 13:33:42 +0100
committerJay Berkenbilt <ejb@ql.org>2021-12-17 18:38:52 +0100
commitfee7489ee4c90c6dbd11e57ecc8e888c8f038716 (patch)
tree9a1872d7e52b2db3ec2cb44109a3a3918927621d /include
parent8c4ad6b946a762fd57443a3647e0cc620ad6eae4 (diff)
downloadqpdf-fee7489ee4c90c6dbd11e57ecc8e888c8f038716.tar.zst
Add Pl_Buffer::getMallocBuffer
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/Pl_Buffer.hh9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/qpdf/Pl_Buffer.hh b/include/qpdf/Pl_Buffer.hh
index 07bc2372..8c402cd4 100644
--- a/include/qpdf/Pl_Buffer.hh
+++ b/include/qpdf/Pl_Buffer.hh
@@ -55,6 +55,15 @@ class Pl_Buffer: public Pipeline
QPDF_DLL
Buffer* getBuffer();
+ // getMallocBuffer behaves in the same was as getBuffer except the
+ // buffer is allocated with malloc(), making it suitable for use
+ // when calling from other languages. If there is no data, *buf is
+ // set to a null pointer and *len is set to 0. Otherwise, *buf is
+ // a buffer of size *len allocated with malloc(). It is the
+ // caller's responsibility to call free() on the buffer.
+ QPDF_DLL
+ void getMallocBuffer(unsigned char **buf, size_t* len);
+
private:
class Members
{