mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-07-18 23:09:49 +02:00
Rework token reading to be separate from the PDF file so we can add support
for compressed object streams.
This commit is contained in:
@ -128,6 +128,7 @@ _pdfioObjLoad(pdfio_obj_t *obj) // I - Object
|
||||
{
|
||||
char line[1024], // Line from file
|
||||
*ptr; // Pointer into line
|
||||
_pdfio_token_t tb; // Token buffer/stack
|
||||
|
||||
|
||||
PDFIO_DEBUG("_pdfioObjLoad(obj=%p(%lu)), offset=%lu\n", obj, (unsigned long)obj->number, (unsigned long)obj->offset);
|
||||
@ -167,9 +168,9 @@ _pdfioObjLoad(pdfio_obj_t *obj) // I - Object
|
||||
}
|
||||
|
||||
// Then grab the object value...
|
||||
_pdfioFileClearTokens(obj->pdf);
|
||||
_pdfioTokenInit(&tb, obj->pdf, (_pdfio_tconsume_cb_t)_pdfioFileConsume, (_pdfio_tpeek_cb_t)_pdfioFilePeek, obj->pdf);
|
||||
|
||||
if (!_pdfioValueRead(obj->pdf, &obj->value))
|
||||
if (!_pdfioValueRead(obj->pdf, &tb, &obj->value))
|
||||
{
|
||||
_pdfioFileError(obj->pdf, "Unable to read value for object %lu.", (unsigned long)obj->number);
|
||||
return (false);
|
||||
|
Reference in New Issue
Block a user