> I need a method of resize the buffer when caching data, so I think there
should be such a method of pdf_stm_buffer_t.
>
> Thanks!
> Yang
It would be useful for me too. Both AESv2 and MD filters profit from
this, since they must cache all input too.
What about:
pdf_status_t pdf_stm_buffer_resize (pdf_stm_buffer_t BUFFER, pdf_size_t
NEW_SIZE);
Resize a given buffer.
If NEW_SIZE is larger than the actual size of @var{buffer} then BUFFER->size
will be increased, while both BUFFER->rp and BUFFER->wp will remain
unchanged.
If NEW_SIZE is shorter than the actual size of BUFFER then the memory
pointed by BUFFER->data will be truncated, BUFFER->size will be
adjusted to the new value and both BUFFER->rp and BUFFER->wp will be
set to BUFFER->size if they are exceeding the new size of the buffer.
Would it fit your needs?