diff options
author | Vincent Sanders <vince@kyllikki.org> | 2018-01-18 00:21:10 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2018-01-18 00:21:10 +0000 |
commit | b1e0e4414ecd3161c0f947daceb8643b5889e51c (patch) | |
tree | ab63f66b3651856f3528bb51e9acf522d0854521 /src/pdf_doc.c | |
parent | c27eb52f96f8070c4be77a387e603508fc4092ce (diff) | |
download | libnspdf-b1e0e4414ecd3161c0f947daceb8643b5889e51c.tar.gz libnspdf-b1e0e4414ecd3161c0f947daceb8643b5889e51c.tar.bz2 |
start to alter parseing to read from cos_stream object
Diffstat (limited to 'src/pdf_doc.c')
-rw-r--r-- | src/pdf_doc.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/pdf_doc.c b/src/pdf_doc.c index 997a3d7..955f737 100644 --- a/src/pdf_doc.c +++ b/src/pdf_doc.c @@ -19,29 +19,27 @@ #include "cos_object.h" #include "pdf_doc.h" -/** - * move offset to next non whitespace byte - */ -nspdferror doc_skip_ws(struct nspdf_doc *doc, uint64_t *offset) +nspdferror nspdf__stream_skip_ws(struct cos_stream *stream, uint64_t *offset) { uint8_t c; /* TODO sort out keeping offset in range */ - c = DOC_BYTE(doc, *offset); + c = stream_byte(stream, *offset); while ((bclass[c] & (BC_WSPC | BC_CMNT) ) != 0) { (*offset)++; /* skip comments */ if ((bclass[c] & BC_CMNT) != 0) { - c = DOC_BYTE(doc, *offset); + c = stream_byte(stream, *offset); while ((bclass[c] & BC_EOLM ) == 0) { (*offset)++; - c = DOC_BYTE(doc, *offset); + c = stream_byte(stream, *offset); } } - c = DOC_BYTE(doc, *offset); + c = stream_byte(stream, *offset); } return NSPDFERROR_OK; } + /** * move offset to next non eol byte */ |