annotate src/dmbstr.h @ 1089:27d041472c8f

Cleanup, rename some variables, etc.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 02 Mar 2015 20:25:44 +0200
parents f4626ee57dad
children e0fb6fa1c689
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
412
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * DMLib
413
a7ab6bf5b012 Correct the file header comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 412
diff changeset
3 * -- Simple bitstream I/O functions
412
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 * Programmed and designed by Matti 'ccr' Hamalainen
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 * (C) Copyright 2012 Tecnic Software productions (TNSP)
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 */
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #ifndef DMBSTR_H
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 #define DMBSTR_H
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 #include "dmlib.h"
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11
1085
f4626ee57dad Add missing C++ guard.
Matti Hamalainen <ccr@tnsp.org>
parents: 812
diff changeset
12
f4626ee57dad Add missing C++ guard.
Matti Hamalainen <ccr@tnsp.org>
parents: 812
diff changeset
13 #ifdef __cplusplus
f4626ee57dad Add missing C++ guard.
Matti Hamalainen <ccr@tnsp.org>
parents: 812
diff changeset
14 extern "C" {
f4626ee57dad Add missing C++ guard.
Matti Hamalainen <ccr@tnsp.org>
parents: 812
diff changeset
15 #endif
f4626ee57dad Add missing C++ guard.
Matti Hamalainen <ccr@tnsp.org>
parents: 812
diff changeset
16
f4626ee57dad Add missing C++ guard.
Matti Hamalainen <ccr@tnsp.org>
parents: 812
diff changeset
17
800
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
18 typedef struct _DMBitStreamContext
412
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 {
1089
27d041472c8f Cleanup, rename some variables, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1085
diff changeset
20 void *fp;
27d041472c8f Cleanup, rename some variables, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1085
diff changeset
21 BOOL (*putByte)(struct _DMBitStreamContext *ctx, Uint8 val);
800
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
22
1089
27d041472c8f Cleanup, rename some variables, etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 1085
diff changeset
23 int outBuf, outBitCount, outByteCount;
800
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
24 } DMBitStreamContext;
412
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
800
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
27 void dmInitBitStreamContext(DMBitStreamContext *ctx);
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
28 BOOL dmPutBits(DMBitStreamContext *ctx, const int val, const int n);
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
29 int dmFlushBitStream(DMBitStreamContext *ctx);
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
30
c63e24f9aa9a Modularize bitstream reader.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
31 int dmInitBitStreamFILE(DMBitStreamContext *ctx, FILE *fp);
412
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 #ifdef __cplusplus
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 }
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 #endif
24548dba1eb6 Add simple bitstream writing functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 #endif // DMBSTR_H