Initial commit of files
This commit is contained in:
52
include/bitlib.h
Normal file
52
include/bitlib.h
Normal file
@ -0,0 +1,52 @@
|
||||
#ifndef __BITLIB_INCLUDE__
|
||||
#define __BITLIB_INCLUDE__
|
||||
|
||||
/******************************************************************************
|
||||
* includes
|
||||
*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <memory.h>
|
||||
|
||||
#include "embtypes.h"
|
||||
|
||||
/******************************************************************************
|
||||
* defines
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* structs & typedefs
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct _bit_struct {
|
||||
const uint8_t *ptr;
|
||||
int bit;
|
||||
int max;
|
||||
int consumed;
|
||||
} BIT_Stream;
|
||||
|
||||
/******************************************************************************
|
||||
* function prototypes
|
||||
*****************************************************************************/
|
||||
/* export C functions to C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
BYTE reverseByteBits(BYTE b);
|
||||
|
||||
void enableBitDebug(int flag);
|
||||
int getBitDirect(const uint8_t *pkt, int bit);
|
||||
uint64_t getBitsDirect(const uint8_t *pkt, int bit, int bits);
|
||||
uint64_t getBitsStream(BIT_Stream *ptr, int bits);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
/******************************************************************************
|
||||
* Macros
|
||||
* ***************************************************************************/
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user