| 1 | /******************************************************************** |
|---|
| 2 | * |
|---|
| 3 | * bitbuffer.h - Utility for extracting bits from a buffer |
|---|
| 4 | * |
|---|
| 5 | * Copyright 1997-2002 TeraLogic, Inc. |
|---|
| 6 | * All Rights Reserved |
|---|
| 7 | * |
|---|
| 8 | * bitBufferCreate: Creates a bitBuffer object from the specified |
|---|
| 9 | * byte buffer. |
|---|
| 10 | * (O) instance: Returns the bitBuffer instance. |
|---|
| 11 | * (I) buffer: The byte buffer. |
|---|
| 12 | * (I) bufSize: Size of the byte buffer. |
|---|
| 13 | * |
|---|
| 14 | * bitBufferDestroy: Destroys a bitBuffer object. |
|---|
| 15 | * (I) instance: The bitBuffer instance. |
|---|
| 16 | * |
|---|
| 17 | * bitBufferGetBits: Extracts the specified number of bits from the |
|---|
| 18 | * bitBuffer. |
|---|
| 19 | * (I) instance: The bitBuffer instance. |
|---|
| 20 | * (I) numberOfBits: Number of bits to be extracted. |
|---|
| 21 | * |
|---|
| 22 | * bitBufferCheckError:Checks the error state of the bitBuffer. Returns |
|---|
| 23 | * "TRUE" if the bitBuffer is in an error state. |
|---|
| 24 | * (I) instance: The bitBuffer instance. |
|---|
| 25 | * |
|---|
| 26 | * _Id: bitbuffer.h,v 1.2 2002/06/13 18:32:24 tvogt Exp |
|---|
| 27 | ********************************************************************/ |
|---|
| 28 | |
|---|
| 29 | #ifndef _bitbuffer_h |
|---|
| 30 | #define _bitbuffer_h |
|---|
| 31 | |
|---|
| 32 | #ifdef __cplusplus |
|---|
| 33 | extern "C" { |
|---|
| 34 | #endif |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | /*typedef struct bitBuffer bitBuffer_t, *bitBufferPtr_t;*/ |
|---|
| 38 | typedef struct bitBuffer bitBuffer_t; |
|---|
| 39 | typedef struct bitBuffer * bitBufferPtr_t; |
|---|
| 40 | |
|---|
| 41 | /* API */ |
|---|
| 42 | DHL_RESULT bitBufferCreate ( bitBufferPtr_t *instance, DS_U8 *buffer, DS_U32 bufSize); |
|---|
| 43 | DHL_RESULT bitBufferDestroy ( bitBufferPtr_t instance); |
|---|
| 44 | DS_U32 bitBufferGetBits (bitBufferPtr_t instance, DS_U8 numberOfBits); |
|---|
| 45 | void bitBufferSkipBits (bitBufferPtr_t instance, DS_U16 numberOfBits); |
|---|
| 46 | DS_U8* bitBufferGetBytePointer (bitBufferPtr_t instance); |
|---|
| 47 | DS_BOOL bitBufferCheckError (bitBufferPtr_t instance); |
|---|
| 48 | |
|---|
| 49 | #ifdef __cplusplus |
|---|
| 50 | } |
|---|
| 51 | #endif |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | #endif /* _bitbuffer_h */ |
|---|