My Project
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
bitStack.h
Go to the documentation of this file.
1
/*==============================================================================
2
File Name: bitStacker.h
3
Author : ccortiz
4
5
Description:
6
Class for stack and unstack bits in a byte buffer.
7
==============================================================================
8
*/
9
10
#ifndef BITSTACK_H_
11
#define BITSTACK_H_
12
13
#define _MAX_DATA_STACK_SIZE_ 1024
14
#define _MAX_BITSTACK_INSTANCES_ 40
15
16
#include "
dataTypes.h
"
17
#include <string.h>
18
19
typedef
struct
c_bitStack_Privates
*
bitStack_PrivatesPtr
;
20
21
struct
c_bitStack_Privates
{
22
byte
dataStack
[
_MAX_DATA_STACK_SIZE_
];
23
uint32
stackSize
;
24
uint32
auxUsedBits
;
25
enum
endianness
outputEndianness
;
26
27
uint32
unstackIndex
;
/* Index of current unstacked byte. */
28
uint32
unstackedBit
;
/* Bit of unstacked byte currently unstacked. */
29
uint32
unstackedByte
;
/* Byte of dataStack currently unstacked. */
30
boolean
firstUnstak
;
31
};
32
33
int
new_bitStack
(
void
);
34
35
sint32
stackData
(
uint16
bitStackDescriptor,
unsigned
char
* data,
uint32
dataLength);
36
uint32
unstackData
(
uint16
bitStackDescriptor,
uint8
nBits);
37
void
showStack
(
uint16
bitStackDescriptor);
38
uint32
getStackSize
(
uint16
bitStackDescriptor);
39
40
void
setOutputEndianness
(
uint16
bitStackDescriptor,
enum
endianness
endianType
);
41
void
clearStack
(
uint16
bitStackDescriptor);
42
byte_ptr
getDataBuffer
(
uint16
bitStackDescriptor);
43
sint32
setDataBuffer
(
uint16
bitStackDescriptor,
byte_ptr
data,
uint16
dataLength);
44
45
46
#endif
/* BITSTACK_H_ */
Generated on Fri Jun 8 2012 11:51:37 for My Project by
1.8.1