Add pdfioObjGetArray.

This commit is contained in:
Michael R Sweet 2021-05-10 21:01:02 -04:00
parent 18853ca3d5
commit b030c24ba1
No known key found for this signature in database
GPG Key ID: 999559A027815955
2 changed files with 21 additions and 0 deletions

View File

@ -60,6 +60,26 @@ _pdfioObjDelete(pdfio_obj_t *obj) // I - Object
}
//
// 'pdfioObjGetArray()' - Get the array associated with an object.
//
pdfio_array_t * // O - Array or `NULL` on error
pdfioObjGetArray(pdfio_obj_t *obj) // I - Object
{
if (!obj)
return (NULL);
if (obj->value.type == PDFIO_VALTYPE_NONE)
_pdfioObjLoad(obj);
if (obj->value.type == PDFIO_VALTYPE_ARRAY)
return (obj->value.value.array);
else
return (NULL);
}
//
// 'pdfioObjGetDict()' - Get the dictionary associated with an object.
//

View File

@ -162,6 +162,7 @@ extern pdfio_file_t *pdfioFileOpen(const char *filename, pdfio_error_cb_t error_
extern bool pdfioObjClose(pdfio_obj_t *obj) PDFIO_PUBLIC;
extern pdfio_stream_t *pdfioObjCreateStream(pdfio_obj_t *obj, pdfio_filter_t compression) PDFIO_PUBLIC;
extern pdfio_array_t *pdfioObjGetArray(pdfio_obj_t *obj) PDFIO_PUBLIC;
extern pdfio_dict_t *pdfioObjGetDict(pdfio_obj_t *obj) PDFIO_PUBLIC;
extern unsigned short pdfioObjGetGeneration(pdfio_obj_t *obj) PDFIO_PUBLIC;
extern size_t pdfioObjGetLength(pdfio_obj_t *obj) PDFIO_PUBLIC;