Rizin
unix-like reverse engineering framework and cli tools
|
Various integer and bit operations. More...
Go to the source code of this file.
Macros | |
#define | bswap16(n) |
#define | bswap32(n) |
#define | bswap64(n) |
#define | conv16be(num) bswap16(num) |
#define | conv32be(num) bswap32(num) |
#define | conv64be(num) bswap64(num) |
#define | conv16le(num) ((uint16_t)(num)) |
#define | conv32le(num) ((uint32_t)(num)) |
#define | conv64le(num) ((uint64_t)(num)) |
#define | write16le(buf, num) write16ne(buf, conv16le(num)) |
#define | write32le(buf, num) write32ne(buf, conv32le(num)) |
#define | tuklib_memcpy_aligned(dest, src, size) memcpy(dest, src, size) |
#define | TUKLIB_USE_UNSAFE_ALIGNED_READS 1 |
#define | aligned_write16be(buf, num) aligned_write16ne((buf), conv16be(num)) |
#define | aligned_write16le(buf, num) aligned_write16ne((buf), conv16le(num)) |
#define | aligned_write32be(buf, num) aligned_write32ne((buf), conv32be(num)) |
#define | aligned_write32le(buf, num) aligned_write32ne((buf), conv32le(num)) |
#define | aligned_write64be(buf, num) aligned_write64ne((buf), conv64be(num)) |
#define | aligned_write64le(buf, num) aligned_write64ne((buf), conv64le(num)) |
#define | bsf32 ctz32 |
Various integer and bit operations.
This file provides macros or functions to do some basic integer and bit operations.
Native endian inline functions (XX = 16, 32, or 64):
Endianness-converting integer operations (these can be macros!) (XX = 16, 32, or 64; Y = b or l):
Since the above can macros, the arguments should have no side effects because they may be evaluated more than once.
Bit scan operations for non-zero 32-bit integers (inline functions):
The above bit scan operations return 0-31. If num is zero, the result is undefined.
Definition in file tuklib_integer.h.
Definition at line 572 of file tuklib_integer.h.
Definition at line 573 of file tuklib_integer.h.
Definition at line 574 of file tuklib_integer.h.
Definition at line 575 of file tuklib_integer.h.
Definition at line 576 of file tuklib_integer.h.
Definition at line 577 of file tuklib_integer.h.
#define bsf32 ctz32 |
Definition at line 740 of file tuklib_integer.h.
#define bswap16 | ( | n | ) |
Definition at line 118 of file tuklib_integer.h.
#define bswap32 | ( | n | ) |
Definition at line 125 of file tuklib_integer.h.
#define bswap64 | ( | n | ) |
Definition at line 134 of file tuklib_integer.h.
Definition at line 168 of file tuklib_integer.h.
Definition at line 177 of file tuklib_integer.h.
Definition at line 171 of file tuklib_integer.h.
Definition at line 180 of file tuklib_integer.h.
Definition at line 174 of file tuklib_integer.h.
Definition at line 183 of file tuklib_integer.h.
Definition at line 437 of file tuklib_integer.h.
#define TUKLIB_USE_UNSAFE_ALIGNED_READS 1 |
Definition at line 440 of file tuklib_integer.h.
Definition at line 356 of file tuklib_integer.h.
Definition at line 357 of file tuklib_integer.h.
Definition at line 524 of file tuklib_integer.h.
References aligned_read16ne(), conv16be, and num.
Definition at line 446 of file tuklib_integer.h.
References num, and tuklib_memcpy_aligned.
Referenced by aligned_read16be(), and aligned_read16le().
Definition at line 540 of file tuklib_integer.h.
References aligned_read32ne(), conv32be, and num.
Definition at line 460 of file tuklib_integer.h.
References num, and tuklib_memcpy_aligned.
Referenced by aligned_read32be(), aligned_read32le(), and LZMA_API().
Definition at line 556 of file tuklib_integer.h.
References aligned_read64ne(), conv64be, and num.
Definition at line 474 of file tuklib_integer.h.
References num, and tuklib_memcpy_aligned.
Referenced by aligned_read64be(), and aligned_read64le().
Definition at line 640 of file tuklib_integer.h.
Definition at line 208 of file tuklib_integer.h.
Referenced by read16be(), and read16le().
Definition at line 331 of file tuklib_integer.h.
References conv32le, num, and read32ne().
Referenced by LZMA_API(), lzma_lzma_props_decode(), and lzma_simple_props_decode().
Definition at line 236 of file tuklib_integer.h.