pdfio_dict_t implementation

This commit is contained in:
Michael R Sweet
2021-04-25 20:12:52 -04:00
parent 2f928f67f5
commit 253717248c
5 changed files with 436 additions and 43 deletions

View File

@@ -20,6 +20,7 @@
struct _pdfio_array_s
{
pdfio_file_t *pdf; // PDF file
size_t num_values, // Number of values in use
alloc_values; // Number of allocated values
_pdfio_value_t *values; // Array of values
@@ -182,6 +183,8 @@ pdfioArrayCreate(pdfio_file_t *pdf) // I - PDF file
if ((a = (pdfio_array_t *)calloc(1, sizeof(pdfio_array_t))) == NULL)
return (NULL);
a->pdf = pdf;
if (pdf->num_arrays >= pdf->alloc_arrays)
{
pdfio_array_t **temp = realloc(pdf->arrays, (pdf->alloc_arrays + 16) * sizeof(pdfio_array_t *));