diff dmbstr.h @ 412:24548dba1eb6

Add simple bitstream writing functions.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 03 Nov 2012 03:49:30 +0200
parents
children a7ab6bf5b012
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dmbstr.h	Sat Nov 03 03:49:30 2012 +0200
@@ -0,0 +1,27 @@
+/*
+ * DMLib
+ * -- Simple bitstream reader functions
+ * Programmed and designed by Matti 'ccr' Hamalainen
+ * (C) Copyright 2012 Tecnic Software productions (TNSP)
+ */
+#ifndef DMBSTR_H
+#define DMBSTR_H
+
+#include "dmlib.h"
+
+typedef struct
+{
+  FILE *fp;
+  int buf, bitcnt, bytecnt;
+} DMBitStream;
+
+
+int   dmInitBitStream(DMBitStream *ctx, FILE *fp);
+BOOL  dmPutBits(DMBitStream *ctx, const int val, const int n);
+int   dmFlushBitStream(DMBitStream *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif // DMBSTR_H