Files
Cnomicon/include/bitlib.h
2021-01-22 10:16:20 -05:00

53 lines
1.4 KiB
C

#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