Token parsing code.

This commit is contained in:
Michael R Sweet
2021-05-01 22:38:11 -04:00
parent e107b94c83
commit 4b05ca6436
5 changed files with 409 additions and 19 deletions

View File

@@ -27,6 +27,21 @@ pdfioStreamClose(pdfio_stream_t *st) // I - Stream
}
//
// 'pdfioStreamConsume()' - Consume bytes from the stream.
//
bool // O - `true` on success, `false` on EOF
pdfioStreamConsume(pdfio_stream_t *st, // I - Stream
size_t bytes)// I - Number of bytes to consume
{
// TODO: Implement me
(void)st;
(void)bytes;
return (false);
}
//
// '_pdfioStreamDelete()' - Free all memory used by a stream.
//
@@ -57,7 +72,7 @@ pdfioStreamGetToken(
char *buffer, // I - String buffer
size_t bufsize) // I - Size of string buffer
{
return (_pdfioTokenRead(buffer, bufsize, (_pdfio_token_cb_t)pdfioStreamPeek, (_pdfio_token_cb_t)pdfioStreamRead, st));
return (_pdfioTokenRead(st->pdf, buffer, bufsize, (_pdfio_tpeek_cb_t)pdfioStreamPeek, (_pdfio_tconsume_cb_t)pdfioStreamConsume, st));
}