diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-12-17 13:33:42 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-12-17 18:38:52 +0100 |
commit | fee7489ee4c90c6dbd11e57ecc8e888c8f038716 (patch) | |
tree | 9a1872d7e52b2db3ec2cb44109a3a3918927621d /include | |
parent | 8c4ad6b946a762fd57443a3647e0cc620ad6eae4 (diff) | |
download | qpdf-fee7489ee4c90c6dbd11e57ecc8e888c8f038716.tar.zst |
Add Pl_Buffer::getMallocBuffer
Diffstat (limited to 'include')
-rw-r--r-- | include/qpdf/Pl_Buffer.hh | 9 |
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 { |