Rizin
unix-like reverse engineering framework and cli tools
rz_types_base.h File Reference
#include <ctype.h>
#include <sys/types.h>
#include <limits.h>
#include <stdbool.h>
#include "rz_types_overflow.h"

Go to the source code of this file.

Classes

union  utAny
 
struct  _ut80
 
struct  _ut96
 
struct  _ut128
 
struct  _ut256
 
struct  _utX
 

Macros

#define cut8   const unsigned char
 
#define ut64   unsigned long long
 
#define st64   long long
 
#define ut32   unsigned int
 
#define st32   int
 
#define ut16   unsigned short
 
#define st16   short
 
#define ut8   unsigned char
 
#define st8   signed char
 
#define boolt   int
 
#define RZ_ALIGNED(x)   __attribute__((aligned(x)))
 
#define RZ_EMPTY    { 0 }
 
#define RZ_EMPTY2
 
#define ST64_MAX   ((st64)0x7FFFFFFFFFFFFFFFULL)
 
#define ST64_MIN   ((st64)(-ST64_MAX - 1))
 
#define UT64_MAX   0xFFFFFFFFFFFFFFFFULL
 
#define UT64_GT0   0x8000000000000000ULL
 
#define UT64_LT0   0x7FFFFFFFFFFFFFFFULL
 
#define UT64_MIN   0ULL
 
#define UT64_32U   0xFFFFFFFF00000000ULL
 
#define UT64_16U   0xFFFFFFFFFFFF0000ULL
 
#define UT64_8U   0xFFFFFFFFFFFFFF00ULL
 
#define UT32_MIN   0U
 
#define UT16_MIN   0U
 
#define UT32_GT0   0x80000000U
 
#define UT32_LT0   0x7FFFFFFFU
 
#define ST32_MAX   0x7FFFFFFF
 
#define ST32_MIN   (-ST32_MAX - 1)
 
#define UT32_MAX   0xFFFFFFFFU
 
#define ST16_MAX   0x7FFF
 
#define ST16_MIN   (-ST16_MAX - 1)
 
#define UT16_GT0   0x8000U
 
#define UT16_MAX   0xFFFFU
 
#define ST8_MAX   0x7F
 
#define ST8_MIN   (-ST8_MAX - 1)
 
#define UT8_GT0   0x80U
 
#define UT8_MAX   0xFFU
 
#define UT8_MIN   0x00U
 
#define ASCII_MIN   32
 
#define ASCII_MAX   127
 
#define SZT_MAX   UT64_MAX
 
#define SZT_MIN   UT64_MIN
 
#define SSZT_MAX   ST64_MAX
 
#define SSZT_MIN   ST64_MIN
 
#define UT64_ALIGN(x)   (x + (x - (x % sizeof(ut64))))
 
#define UT32_ALIGN(x)   (x + (x - (x % sizeof(ut32))))
 
#define UT16_ALIGN(x)   (x + (x - (x % sizeof(ut16))))
 
#define UT32_LO(x)   ((ut32)((x)&UT32_MAX))
 
#define UT32_HI(x)   ((ut32)(((ut64)(x)) >> 32) & UT32_MAX)
 
#define RZ_BETWEEN(x, y, z)   (((y) >= (x)) && ((y) <= (z)))
 
#define RZ_ROUND(x, y)   ((x) % (y)) ? (x) + ((y) - ((x) % (y))) : (x)
 
#define RZ_DIM(x, y, z)
 
#define RZ_MAX(x, y)   (((x) > (y)) ? (x) : (y))
 
#define RZ_MAX_DEFINED
 
#define RZ_MIN(x, y)   (((x) > (y)) ? (y) : (x))
 
#define RZ_MIN_DEFINED
 
#define RZ_ABS(x)   (((x) < 0) ? -(x) : (x))
 
#define RZ_BTW(x, y, z)   (((x) >= (y)) && ((y) <= (z))) ? y : x
 
#define B_IS_SET(x, n)   (((x) & (1ULL << (n))) ? 1 : 0)
 
#define B_SET(x, n)   ((x) |= (1ULL << (n)))
 
#define B_EVEN(x)   (((x)&1) == 0)
 
#define B_ODD(x)   (!B_EVEN((x)))
 
#define B_UNSET(x, n)   ((x) &= ~(1ULL << (n)))
 
#define B_TOGGLE(x, n)   ((x) ^= (1ULL << (n)))
 
#define B11111   31
 
#define B11110   30
 
#define B11101   29
 
#define B11100   28
 
#define B11011   27
 
#define B11010   26
 
#define B11001   25
 
#define B11000   24
 
#define B10111   23
 
#define B10110   22
 
#define B10101   21
 
#define B10100   20
 
#define B10011   19
 
#define B10010   18
 
#define B10001   17
 
#define B10000   16
 
#define B1111   15
 
#define B1110   14
 
#define B1101   13
 
#define B1100   12
 
#define B1011   11
 
#define B1010   10
 
#define B1001   9
 
#define B1000   8
 
#define B0111   7
 
#define B0110   6
 
#define B0101   5
 
#define B0100   4
 
#define B0011   3
 
#define B0010   2
 
#define B0001   1
 
#define B0000   0
 
#define B4(a, b, c, d)   ((a << 12) | (b << 8) | (c << 4) | (d))
 
#define INFINITY   (1.0f / 0.0f)
 
#define NAN   (0.0f / 0.0f)
 
#define HEAPTYPE(x)
 

Typedefs

typedef struct _ut80 ut80
 
typedef struct _ut96 ut96
 
typedef struct _ut128 ut128
 
typedef struct _ut256 ut256
 
typedef struct _utX utX
 

Functions

typedef RZ_ALIGNED (1) ut16 uut16
 

Macro Definition Documentation

◆ ASCII_MAX

#define ASCII_MAX   127

Definition at line 110 of file rz_types_base.h.

◆ ASCII_MIN

#define ASCII_MIN   32

Definition at line 109 of file rz_types_base.h.

◆ B0000

#define B0000   0

Definition at line 187 of file rz_types_base.h.

◆ B0001

#define B0001   1

Definition at line 186 of file rz_types_base.h.

◆ B0010

#define B0010   2

Definition at line 185 of file rz_types_base.h.

◆ B0011

#define B0011   3

Definition at line 184 of file rz_types_base.h.

◆ B0100

#define B0100   4

Definition at line 183 of file rz_types_base.h.

◆ B0101

#define B0101   5

Definition at line 182 of file rz_types_base.h.

◆ B0110

#define B0110   6

Definition at line 181 of file rz_types_base.h.

◆ B0111

#define B0111   7

Definition at line 180 of file rz_types_base.h.

◆ B1000

#define B1000   8

Definition at line 179 of file rz_types_base.h.

◆ B10000

#define B10000   16

Definition at line 171 of file rz_types_base.h.

◆ B10001

#define B10001   17

Definition at line 170 of file rz_types_base.h.

◆ B1001

#define B1001   9

Definition at line 178 of file rz_types_base.h.

◆ B10010

#define B10010   18

Definition at line 169 of file rz_types_base.h.

◆ B10011

#define B10011   19

Definition at line 168 of file rz_types_base.h.

◆ B1010

#define B1010   10

Definition at line 177 of file rz_types_base.h.

◆ B10100

#define B10100   20

Definition at line 167 of file rz_types_base.h.

◆ B10101

#define B10101   21

Definition at line 166 of file rz_types_base.h.

◆ B1011

#define B1011   11

Definition at line 176 of file rz_types_base.h.

◆ B10110

#define B10110   22

Definition at line 165 of file rz_types_base.h.

◆ B10111

#define B10111   23

Definition at line 164 of file rz_types_base.h.

◆ B1100

#define B1100   12

Definition at line 175 of file rz_types_base.h.

◆ B11000

#define B11000   24

Definition at line 163 of file rz_types_base.h.

◆ B11001

#define B11001   25

Definition at line 162 of file rz_types_base.h.

◆ B1101

#define B1101   13

Definition at line 174 of file rz_types_base.h.

◆ B11010

#define B11010   26

Definition at line 161 of file rz_types_base.h.

◆ B11011

#define B11011   27

Definition at line 160 of file rz_types_base.h.

◆ B1110

#define B1110   14

Definition at line 173 of file rz_types_base.h.

◆ B11100

#define B11100   28

Definition at line 159 of file rz_types_base.h.

◆ B11101

#define B11101   29

Definition at line 158 of file rz_types_base.h.

◆ B1111

#define B1111   15

Definition at line 172 of file rz_types_base.h.

◆ B11110

#define B11110   30

Definition at line 157 of file rz_types_base.h.

◆ B11111

#define B11111   31

Definition at line 156 of file rz_types_base.h.

◆ B4

#define B4 (   a,
  b,
  c,
  d 
)    ((a << 12) | (b << 8) | (c << 4) | (d))

Definition at line 189 of file rz_types_base.h.

◆ B_EVEN

#define B_EVEN (   x)    (((x)&1) == 0)

Definition at line 151 of file rz_types_base.h.

◆ B_IS_SET

#define B_IS_SET (   x,
  n 
)    (((x) & (1ULL << (n))) ? 1 : 0)

Definition at line 149 of file rz_types_base.h.

◆ B_ODD

#define B_ODD (   x)    (!B_EVEN((x)))

Definition at line 152 of file rz_types_base.h.

◆ B_SET

#define B_SET (   x,
  n 
)    ((x) |= (1ULL << (n)))

Definition at line 150 of file rz_types_base.h.

◆ B_TOGGLE

#define B_TOGGLE (   x,
  n 
)    ((x) ^= (1ULL << (n)))

Definition at line 154 of file rz_types_base.h.

◆ B_UNSET

#define B_UNSET (   x,
  n 
)    ((x) &= ~(1ULL << (n)))

Definition at line 153 of file rz_types_base.h.

◆ boolt

#define boolt   int

Definition at line 17 of file rz_types_base.h.

◆ cut8

#define cut8   const unsigned char

Definition at line 8 of file rz_types_base.h.

◆ HEAPTYPE

#define HEAPTYPE (   x)
Value:
static x *x##_new(x n) { \
x *m = malloc(sizeof(x)); \
return m ? *m = n, m : m; \
}
void * malloc(size_t size)
Definition: malloc.c:123
int x
Definition: mipsasm.c:20
int n
Definition: mipsasm.c:19

Definition at line 224 of file rz_types_base.h.

◆ INFINITY

#define INFINITY   (1.0f / 0.0f)

Definition at line 193 of file rz_types_base.h.

◆ NAN

#define NAN   (0.0f / 0.0f)

Definition at line 197 of file rz_types_base.h.

◆ RZ_ABS

#define RZ_ABS (   x)    (((x) < 0) ? -(x) : (x))

Definition at line 143 of file rz_types_base.h.

◆ RZ_ALIGNED

#define RZ_ALIGNED (   x)    __attribute__((aligned(x)))

Definition at line 26 of file rz_types_base.h.

◆ RZ_BETWEEN

#define RZ_BETWEEN (   x,
  y,
 
)    (((y) >= (x)) && ((y) <= (z)))

Definition at line 131 of file rz_types_base.h.

◆ RZ_BTW

#define RZ_BTW (   x,
  y,
 
)    (((x) >= (y)) && ((y) <= (z))) ? y : x

Definition at line 144 of file rz_types_base.h.

◆ RZ_DIM

#define RZ_DIM (   x,
  y,
 
)
Value:
(((x) < (y)) ? (y) : ((x) > (z)) ? (z) \
: (x))

Definition at line 133 of file rz_types_base.h.

◆ RZ_EMPTY

#define RZ_EMPTY    { 0 }

Definition at line 68 of file rz_types_base.h.

◆ RZ_EMPTY2

#define RZ_EMPTY2
Value:
{ \
{ 0 } \
}

Definition at line 70 of file rz_types_base.h.

◆ RZ_MAX

#define RZ_MAX (   x,
 
)    (((x) > (y)) ? (x) : (y))

Definition at line 136 of file rz_types_base.h.

◆ RZ_MAX_DEFINED

#define RZ_MAX_DEFINED

Definition at line 137 of file rz_types_base.h.

◆ RZ_MIN

#define RZ_MIN (   x,
 
)    (((x) > (y)) ? (y) : (x))

Definition at line 140 of file rz_types_base.h.

◆ RZ_MIN_DEFINED

#define RZ_MIN_DEFINED

Definition at line 141 of file rz_types_base.h.

◆ RZ_ROUND

#define RZ_ROUND (   x,
 
)    ((x) % (y)) ? (x) + ((y) - ((x) % (y))) : (x)

Definition at line 132 of file rz_types_base.h.

◆ SSZT_MAX

#define SSZT_MAX   ST64_MAX

Definition at line 120 of file rz_types_base.h.

◆ SSZT_MIN

#define SSZT_MIN   ST64_MIN

Definition at line 121 of file rz_types_base.h.

◆ st16

#define st16   short

Definition at line 14 of file rz_types_base.h.

◆ ST16_MAX

#define ST16_MAX   0x7FFF

Definition at line 100 of file rz_types_base.h.

◆ ST16_MIN

#define ST16_MIN   (-ST16_MAX - 1)

Definition at line 101 of file rz_types_base.h.

◆ st32

#define st32   int

Definition at line 12 of file rz_types_base.h.

◆ ST32_MAX

#define ST32_MAX   0x7FFFFFFF

Definition at line 97 of file rz_types_base.h.

◆ ST32_MIN

#define ST32_MIN   (-ST32_MAX - 1)

Definition at line 98 of file rz_types_base.h.

◆ st64

#define st64   long long

Definition at line 10 of file rz_types_base.h.

◆ ST64_MAX

#define ST64_MAX   ((st64)0x7FFFFFFFFFFFFFFFULL)

Definition at line 84 of file rz_types_base.h.

◆ ST64_MIN

#define ST64_MIN   ((st64)(-ST64_MAX - 1))

Definition at line 85 of file rz_types_base.h.

◆ st8

#define st8   signed char

Definition at line 16 of file rz_types_base.h.

◆ ST8_MAX

#define ST8_MAX   0x7F

Definition at line 104 of file rz_types_base.h.

◆ ST8_MIN

#define ST8_MIN   (-ST8_MAX - 1)

Definition at line 105 of file rz_types_base.h.

◆ SZT_MAX

#define SZT_MAX   UT64_MAX

Definition at line 118 of file rz_types_base.h.

◆ SZT_MIN

#define SZT_MIN   UT64_MIN

Definition at line 119 of file rz_types_base.h.

◆ ut16

#define ut16   unsigned short

Definition at line 13 of file rz_types_base.h.

◆ UT16_ALIGN

#define UT16_ALIGN (   x)    (x + (x - (x % sizeof(ut16))))

Definition at line 126 of file rz_types_base.h.

◆ UT16_GT0

#define UT16_GT0   0x8000U

Definition at line 102 of file rz_types_base.h.

◆ UT16_MAX

#define UT16_MAX   0xFFFFU

Definition at line 103 of file rz_types_base.h.

◆ UT16_MIN

#define UT16_MIN   0U

Definition at line 94 of file rz_types_base.h.

◆ ut32

#define ut32   unsigned int

Definition at line 11 of file rz_types_base.h.

◆ UT32_ALIGN

#define UT32_ALIGN (   x)    (x + (x - (x % sizeof(ut32))))

Definition at line 125 of file rz_types_base.h.

◆ UT32_GT0

#define UT32_GT0   0x80000000U

Definition at line 95 of file rz_types_base.h.

◆ UT32_HI

#define UT32_HI (   x)    ((ut32)(((ut64)(x)) >> 32) & UT32_MAX)

Definition at line 129 of file rz_types_base.h.

◆ UT32_LO

#define UT32_LO (   x)    ((ut32)((x)&UT32_MAX))

Definition at line 128 of file rz_types_base.h.

◆ UT32_LT0

#define UT32_LT0   0x7FFFFFFFU

Definition at line 96 of file rz_types_base.h.

◆ UT32_MAX

#define UT32_MAX   0xFFFFFFFFU

Definition at line 99 of file rz_types_base.h.

◆ UT32_MIN

#define UT32_MIN   0U

Definition at line 93 of file rz_types_base.h.

◆ ut64

#define ut64   unsigned long long

Definition at line 9 of file rz_types_base.h.

◆ UT64_16U

#define UT64_16U   0xFFFFFFFFFFFF0000ULL

Definition at line 91 of file rz_types_base.h.

◆ UT64_32U

#define UT64_32U   0xFFFFFFFF00000000ULL

Definition at line 90 of file rz_types_base.h.

◆ UT64_8U

#define UT64_8U   0xFFFFFFFFFFFFFF00ULL

Definition at line 92 of file rz_types_base.h.

◆ UT64_ALIGN

#define UT64_ALIGN (   x)    (x + (x - (x % sizeof(ut64))))

Definition at line 124 of file rz_types_base.h.

◆ UT64_GT0

#define UT64_GT0   0x8000000000000000ULL

Definition at line 87 of file rz_types_base.h.

◆ UT64_LT0

#define UT64_LT0   0x7FFFFFFFFFFFFFFFULL

Definition at line 88 of file rz_types_base.h.

◆ UT64_MAX

#define UT64_MAX   0xFFFFFFFFFFFFFFFFULL

Definition at line 86 of file rz_types_base.h.

◆ UT64_MIN

#define UT64_MIN   0ULL

Definition at line 89 of file rz_types_base.h.

◆ ut8

#define ut8   unsigned char

Definition at line 15 of file rz_types_base.h.

◆ UT8_GT0

#define UT8_GT0   0x80U

Definition at line 106 of file rz_types_base.h.

◆ UT8_MAX

#define UT8_MAX   0xFFU

Definition at line 107 of file rz_types_base.h.

◆ UT8_MIN

#define UT8_MIN   0x00U

Definition at line 108 of file rz_types_base.h.

Typedef Documentation

◆ ut128

typedef struct _ut128 ut128

◆ ut256

typedef struct _ut256 ut256

◆ ut80

typedef struct _ut80 ut80

◆ ut96

typedef struct _ut96 ut96

◆ utX

typedef struct _utX utX

Function Documentation

◆ RZ_ALIGNED()

typedef RZ_ALIGNED ( )

Referenced by search_collisions().