1 /***********************************************************HeaderBegin*******
2 *
3 * File: bitio.h
4 *
5 * Author: T.W. M.F.
6 * Created: 23-July-96
7 *
8 * Description: Routines for buffering and bit-io
9 *
10 * Notes:
11 *
12 * Modified:
13 *
14 ***********************************************************HeaderEnd*********/
15
16 #ifndef _BITIO_H
17 #define _BITIO_H
18
19 #include <stdio.h>
20
21
22
23 /***********************************************************CommentBegin******
24 *
25 * -- Bitstr -- Bitstream Type
26 *
27 * Author: T.W.
28 *
29 * Created: 23-July-96
30 *
31 * Description: int size buffer size in bit
32 * int ind indicator; number of bits in buffer
33 * int actualSize actual size of the buffer (read in)
34 * Byte *b pointer to buffer
35 * FILE *fp pointer to file
36 *
37 * Note: -
38 *
39 * See also: -
40 *
41 * Modified: 13-Aug-96 K.S.
42 *
43 *****************************************************************************/
44 typedef struct{
45 int size;
46 int ind;
47 int actualSize;
48 Byte *b;
49 FILE *fp;
50 } Bitstr;
51 /***********************************************************CommentEnd********/
52
53 /***********************************************************CommentBegin******
54 *
55 * -- READBIT -- Macro: extracts bit
56 *
57 * Arguments in: x, l
58 *
59 * Return values: bit number l (starting from MSB) out of x
60 *****************************************************************************/
61 #define READBIT(x,l) (unsigned long) (((x) & (1UL << (l))) ? 1 : 0)
62 /***********************************************************CommentEnd********/
63
64 /***********************************************************CommentBegin******
65 *
66 * -- SETBIT -- Macro: set bit number l to 1 in y
67 *
68 * Arguments in: y, l
69 *
70 * Return values:
71 *****************************************************************************/
72 #define SETBIT(y,l) ((y) |= (1UL << (l)))
73 /***********************************************************CommentEnd********/
74
75 /***********************************************************CommentBegin******
76 *
77 * -- UNSETBIT -- Macro: set bit number l to 0 in y
78 *
79 * Arguments in: y, l
80 *
81 * Return values:
82 *****************************************************************************/
83 #define UNSETBIT(y,l) ((y) &= (~(1UL << (l))))
84 /***********************************************************CommentEnd********/
85
86
87 /*-------------------------------------*
88 | #defines
89 \--------------------------------------*/
90 #define BUFFER_BLOCK_SIZE 512 /* Stepsize for reallocation of buffer */
91
92
93 /* Include prototype file */
94 #include "bitOut.p"
95
96 #endif /* _BITIO_H */
97
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.