ZEDA  1.6.18
Macros | Functions
zeda_bit.h File Reference

bit operations. More...

#include <zeda/zeda_misc.h>
Include dependency graph for zeda_bit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Z_ENDIAN_UNKNOWN   9999
 
#define Z_ENDIAN_LITTLE   1234
 
#define Z_ENDIAN_BIG   4321
 
#define printf_bit(v, w)   fprintf_bit( stdout, (v), (w) )
 output a bit sequence to the standard output. More...
 

Functions

int endian_check (void)
 check type of endian of the current architecture. More...
 
uint16_t endian_reverse16 (uint16_t val)
 convert 16-bit little/big endian to big/little endian. More...
 
uint32_t endian_reverse32 (uint32_t val)
 convert 32-bit little/big endian to big/little endian. More...
 
uint64_t endian_reverse64 (uint64_t val)
 convert 64-bit little/big endian to big/little endian. More...
 
ulong bit_rotate (ulong val, int bitwidth, int d)
 rotate a bit sequence. More...
 
ulong bit_reverse (ulong val, int bitwidth)
 reverse a bit sequence. More...
 
void sprintf_bit (char *str, ulong val, int width)
 convert a bit sequence to a string in binary format. More...
 
void fprintf_bit (FILE *fp, ulong val, int width)
 output a bit sequence to a file in binary format. More...
 

Detailed Description

bit operations.

Author
Zhidao