summaryrefslogtreecommitdiff
path: root/src/cos_object.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2018-01-08 00:17:22 +0000
committerVincent Sanders <vince@kyllikki.org>2018-01-08 00:17:22 +0000
commit119b565de393fdd797e1a3c4f629c936092e9091 (patch)
treef725bc086c48122cec172430b3ffa1732177a807 /src/cos_object.h
parente8dbf1fa8049169e6918cce20e98e309a793cffe (diff)
downloadlibnspdf-119b565de393fdd797e1a3c4f629c936092e9091.tar.gz
libnspdf-119b565de393fdd797e1a3c4f629c936092e9091.tar.bz2
parse stream objects, no filters handled yet
Diffstat (limited to 'src/cos_object.h')
-rw-r--r--src/cos_object.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/cos_object.h b/src/cos_object.h
index 077be3b..8d0f910 100644
--- a/src/cos_object.h
+++ b/src/cos_object.h
@@ -1,18 +1,18 @@
struct nspdf_doc;
enum cos_type {
- COS_TYPE_NULL,
+ COS_TYPE_NULL, /* 0 */
COS_TYPE_BOOL,
COS_TYPE_INT,
COS_TYPE_REAL,
COS_TYPE_NAME,
COS_TYPE_STRING,
- COS_TYPE_ARRAY,
+ COS_TYPE_ARRAY, /* 6 */
COS_TYPE_DICTIONARY,
COS_TYPE_NAMETREE,
COS_TYPE_NUMBERTREE,
COS_TYPE_STREAM,
- COS_TYPE_REFERENCE,
+ COS_TYPE_REFERENCE, /* 11 */
};
struct cos_object;
@@ -37,22 +37,20 @@ struct cos_array_entry {
};
struct cos_string {
- uint8_t *data;
- size_t length;
- size_t alloc;
+ uint8_t *data; /**< string data */
+ size_t length; /**< string length */
+ size_t alloc; /**< memory allocation for string */
};
struct cos_reference {
- /** id of indirect object */
- uint64_t id;
-
- /* generation of indirect object */
- uint64_t generation;
+ uint64_t id; /**< id of indirect object */
+ uint64_t generation; /**< generation of indirect object */
};
struct cos_stream {
- uint8_t *data;
- size_t length;
+ const uint8_t *data; /**< decoded stream data */
+ int64_t length; /**< decoded stream length */
+ size_t alloc; /**< memory allocated for stream */
};