My Project
 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 
20 
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_ */