bit-release/bit.h

38 lines
1.3 KiB
C

#ifndef _BIT_H
#define _BIT_H
/* INCLUDES ==================================================================*/
#include <linux/types.h>
/* MACROS ====================================================================*/
//#define BIT_VERBOSE
#define BIT_DEFAULT_WIDTH 16
#define BIT_MIN_WIDTH 4
#ifdef BIT_VERBOSE
#define VERBOSE(v, m, f, t) ({ if(v) printf("%d:%s %s\n", t, f, m ); })
#define VERBOSE_INT(v, m, f, t, i) ({ if(v) printf("%d:%s %s %d\n", t, f, m, i); })
#define VERBOSE_STR(v, m, f, t, s) ({ if(v) printf("%d:%s %s %s\n", t, f, m, s); })
#else
#define VERBOSE(v, m, f, t)
#define VERBOSE_INT(v, m, f, t, i)
#define VERBOSE_STR(v, m, f, t, s)
#endif
/* ENUMERATIONS ==============================================================*/
/* STRUCTS ===================================================================*/
/* GLOBAL VARIABLES ==========================================================*/
/* PROTOTYPES ================================================================*/
void bit_print_buffer_u8(void *buf, unsigned long len, unsigned long width, int print_header);
void bit_print_buffer_u32(void *buf, unsigned long len, int print_header, int byteswap);
/* INLINE FUNCTIONS ==========================================================*/
#endif //ifndef _BIT_H