summaryrefslogtreecommitdiff
path: root/src/cos_stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cos_stream.h')
-rw-r--r--src/cos_stream.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/cos_stream.h b/src/cos_stream.h
new file mode 100644
index 0000000..0a4992c
--- /dev/null
+++ b/src/cos_stream.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2018 Vincent Sanders <vince@netsurf-browser.org>
+ *
+ * This file is part of libnspdf.
+ *
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+/**
+ * \file
+ * NetSurf PDF library COS stream
+ */
+
+#ifndef NSPDF__COS_STREAM_H_
+#define NSPDF__COS_STREAM_H_
+
+/* stream offset type */
+typedef unsigned int strmoff_t;
+
+/**
+ * stream of data.
+ */
+struct cos_stream {
+ strmoff_t length; /**< decoded stream length */
+ size_t alloc; /**< memory allocated for stream */
+ const uint8_t *data; /**< decoded stream data */
+};
+
+static inline uint8_t
+stream_byte(struct cos_stream *stream, strmoff_t offset)
+{
+ return *(stream->data + offset);
+}
+
+#endif