summaryrefslogtreecommitdiff
path: root/src/lzw.h
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-04-03 10:07:23 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2017-04-04 09:36:04 +0100
commit960c3b6d2229dcc7cc4a4ef60838329b78880e66 (patch)
treea5e3bc2913107b61e138daafdc58f85ffc3bb3f8 /src/lzw.h
parent8c42f9f934005ba40645ba326b74c8f8b0675df2 (diff)
downloadlibnsgif-960c3b6d2229dcc7cc4a4ef60838329b78880e66.tar.gz
libnsgif-960c3b6d2229dcc7cc4a4ef60838329b78880e66.tar.bz2
New LZW decoder: Add client calls to create/destroy LZW contexts.
Diffstat (limited to 'src/lzw.h')
-rw-r--r--src/lzw.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lzw.h b/src/lzw.h
index 0683ad0..a908414 100644
--- a/src/lzw.h
+++ b/src/lzw.h
@@ -17,12 +17,36 @@
*/
+/* Declare lzw internal context structure */
+struct lzw_ctx;
+
+
/** LZW decoding response codes */
typedef enum lzw_result {
LZW_OK, /**< Success */
LZW_OK_EOD, /**< Success; reached zero-length sub-block */
+ LZW_NO_MEM, /**< Error: Out of memory */
LZW_NO_DATA, /**< Error: Out of data */
} lzw_result;
+/**
+ * Create an LZW decompression context.
+ *
+ * \param[out] ctx Returns an LZW decompression context. Caller owned,
+ * free with lzw_context_destroy().
+ * \return LZW_OK on success, or appropriate error code otherwise.
+ */
+lzw_result lzw_context_create(
+ struct lzw_ctx **ctx);
+
+/**
+ * Destroy an LZW decompression context.
+ *
+ * \param[in] ctx The LZW decompression context to destroy.
+ */
+void lzw_context_destroy(
+ struct lzw_ctx *ctx);
+
+
#endif