Rizin
unix-like reverse engineering framework and cli tools
rz_types.h File Reference
#include <rz_userconf.h>
#include <rz_util/rz_str_util.h>
#include <stddef.h>
#include <assert.h>
#include <errno.h>
#include <rz_types_base.h>
#include <rz_constructor.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include <rz_endian.h>

Go to the source code of this file.

Macros

#define _FILE_OFFSET_BITS   64
 
#define RZ_MODE_PRINT   0x000
 
#define RZ_MODE_RIZINCMD   0x001
 
#define RZ_MODE_SET   0x002
 
#define RZ_MODE_SIMPLE   0x004
 
#define RZ_MODE_JSON   0x008
 
#define RZ_MODE_ARRAY   0x010
 
#define RZ_MODE_SIMPLEST   0x020
 
#define RZ_MODE_CLASSDUMP   0x040
 
#define RZ_MODE_EQUAL   0x080
 
#define RZ_IN   /* do not use, implicit */
 
#define RZ_OUT   /* parameter is written, not read */
 
#define RZ_INOUT   /* parameter is read and written */
 
#define RZ_OWN   /* pointer ownership is transferred */
 
#define RZ_BORROW   /* pointer ownership is not transferred, it must not be freed by the receiver */
 
#define RZ_NONNULL   /* pointer can not be null */
 
#define RZ_NULLABLE   /* pointer can be null */
 
#define RZ_DEPRECATE   /* should not be used in new code and should/will be removed in the future */
 
#define RZ_IFNULL(x)   /* default value for the pointer when null */
 
#define RZ_UNUSED   /* unused */
 
#define RZ_PERM_R   4
 
#define RZ_PERM_W   2
 
#define RZ_PERM_X   1
 
#define RZ_PERM_RW   (RZ_PERM_R | RZ_PERM_W)
 
#define RZ_PERM_RX   (RZ_PERM_R | RZ_PERM_X)
 
#define RZ_PERM_RWX   (RZ_PERM_R | RZ_PERM_W | RZ_PERM_X)
 
#define RZ_PERM_WX   (RZ_PERM_W | RZ_PERM_X)
 
#define RZ_PERM_SHAR   8
 
#define RZ_PERM_PRIV   16
 
#define RZ_PERM_ACCESS   32
 
#define RZ_PERM_CREAT   64
 
#define UNUSED_FUNCTION(x)   UNUSED_##x
 
#define __KFBSD__   0
 
#define TARGET_OS_IPHONE   0
 
#define FUNC_ATTR_MALLOC
 
#define FUNC_ATTR_ALLOC_SIZE(x)
 
#define FUNC_ATTR_ALLOC_SIZE_PROD(x, y)
 
#define FUNC_ATTR_ALLOC_ALIGN(x)
 
#define FUNC_ATTR_PURE
 
#define FUNC_ATTR_CONST
 
#define FUNC_ATTR_USED
 
#define FUNC_ATTR_WARN_UNUSED_RESULT
 
#define FUNC_ATTR_ALWAYS_INLINE
 
#define RZ_PRINTF_CHECK(fmt, dots)
 
#define _GNU_SOURCE
 
#define RZ_SYS_DIR   "/"
 
#define RZ_SYS_ENVSEP   ":"
 
#define RZ_SYS_HOME   "HOME"
 
#define RZ_SYS_TMP   "TMPDIR"
 
#define RZ_JOIN_2_PATHS(p1, p2)   p1 RZ_SYS_DIR p2
 
#define RZ_JOIN_3_PATHS(p1, p2, p3)   p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3
 
#define RZ_JOIN_4_PATHS(p1, p2, p3, p4)   p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4
 
#define RZ_JOIN_5_PATHS(p1, p2, p3, p4, p5)   p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4 RZ_SYS_DIR p5
 
#define __packed   __attribute__((__packed__))
 
#define CTO(y, z)   ((size_t) & ((y *)0)->z)
 
#define CTA(x, y, z)   (x + CTO(y, z))
 
#define CTI(x, y, z)   (*((size_t *)(CTA(x, y, z))))
 
#define CTS(x, y, z, t, v)
 
#define RZ_IPI
 
#define RZ_HEAP
 
#define RZ_API
 
#define RZ_LIB_VERSION_HEADER(x)    RZ_API const char *x##_version(void)
 
#define RZ_LIB_VERSION(x)
 
#define BITS2BYTES(x)   (((x) / 8) + (((x) % 8) ? 1 : 0))
 
#define ZERO_FILL(x)   memset(&x, 0, sizeof(x))
 
#define RZ_NEWS0(x, y)   (x *)calloc(y, sizeof(x))
 
#define RZ_NEWS(x, y)   (x *)malloc(sizeof(x) * (y))
 
#define RZ_NEW0(x)   (x *)calloc(1, sizeof(x))
 
#define RZ_NEW(x)   (x *)malloc(sizeof(x))
 
#define RZ_NEWCOPY(x, y)   (x *)rz_new_copy(sizeof(x), y)
 
#define RZ_NEW_COPY(x, y)
 
#define RZ_MEM_ALIGN(x)   ((void *)(size_t)(((ut64)(size_t)x) & 0xfffffffffffff000LL))
 
#define RZ_ARRAY_SIZE(x)   (sizeof(x) / sizeof((x)[0]))
 
#define RZ_PTR_MOVE(d, s)
 
#define RZ_PTR_ALIGN(v, t)    ((char *)(((size_t)(v)) & ~(t - 1)))
 
#define RZ_PTR_ALIGN_NEXT(v, t)    ((char *)(((size_t)(v) + (t - 1)) & ~(t - 1)))
 
#define RZ_BIT_MASK32(x, y)   ((1UL << (x)) - (1UL << (y)))
 
#define RZ_BIT_SET(x, y)   (((ut8 *)x)[y >> 4] |= (1 << (y & 0xf)))
 
#define RZ_BIT_UNSET(x, y)   (((ut8 *)x)[y >> 4] &= ~(1 << (y & 0xf)))
 
#define RZ_BIT_TOGGLE(x, y)   (RZ_BIT_CHK(x, y) ? RZ_BIT_UNSET(x, y) : RZ_BIT_SET(x, y))
 
#define RZ_BIT_CHK(x, y)   (*(x) & (1 << (y)))
 
#define PERROR_WITH_FILELINE   0
 
#define rz_sys_perror(x)   rz_sys_perror_str(x);
 
#define eprintf(...)   fprintf(stderr, __VA_ARGS__)
 
#define HAVE_EPRINTF   1
 
#define typeof(arg)   __typeof__(arg)
 
#define rz_offsetof(type, member)   offsetof(type, member)
 
#define RZ_FREE(x)
 
#define RZ_FREE_CUSTOM(x, y)
 
#define PFMT64x   "llx"
 
#define PFMT64d   "lld"
 
#define PFMT64u   "llu"
 
#define PFMT64o   "llo"
 
#define PFMTSZx   "zx"
 
#define PFMTSZd   "zd"
 
#define PFMTSZu   "zu"
 
#define PFMTSZo   "zo"
 
#define LDBLFMT   "Lf"
 
#define HHXFMT   "hhx"
 
#define PFMTDPTR   "td"
 
#define PFMT32x   "x"
 
#define PFMT32d   "d"
 
#define PFMT32u   "u"
 
#define PFMT32o   "o"
 
#define O_BINARY   0
 
#define RZ_SYS_BASE   ((ut64)0x8048000)
 
#define RZ_SYS_ARCH   "unknown"
 
#define RZ_SYS_BITS   RZ_SYS_BITS_32
 
#define RZ_SYS_ENDIAN   0
 
#define RZ_SYS_ENDIAN_NONE   0
 
#define RZ_SYS_ENDIAN_LITTLE   1
 
#define RZ_SYS_ENDIAN_BIG   2
 
#define RZ_SYS_ENDIAN_BI   3
 
#define RZ_SYS_OS   "unknown"
 
#define RZ_V_NOT(op, fail_ret)
 
#define rz_xwrite(fd, buf, count)   RZ_V_NOT(write(fd, buf, count), -1)
 
#define rz_xread(fd, buf, count)   RZ_V_NOT(read(fd, buf, count), -1)
 
#define rz_xfreopen(pathname, mode, stream)   RZ_V_NOT(freopen(pathname, mode, stream), NULL)
 
#define container_of(ptr, type, member)   ((type *)((char *)(__typeof__(((type *)0)->member) *){ ptr } - offsetof(type, member)))
 
#define RZ_REF_NAME   refcount
 
#define rz_ref(x)   x->RZ_REF_NAME++;
 
#define rz_ref_init(x)   x->RZ_REF_NAME = 1
 
#define rz_unref(x, f)
 
#define RZ_REF_TYPE   RzRef RZ_REF_NAME
 
#define RZ_REF_FUNCTIONS(s, n)
 

Typedefs

typedef int(* PrintfCallback) (const char *str,...) RZ_PRINTF_CHECK(1
 
typedef int RzRef
 

Enumerations

enum  RzOutputMode {
  RZ_OUTPUT_MODE_STANDARD = 1 << 0 , RZ_OUTPUT_MODE_JSON = 1 << 1 , RZ_OUTPUT_MODE_RIZIN = 1 << 2 , RZ_OUTPUT_MODE_QUIET = 1 << 3 ,
  RZ_OUTPUT_MODE_SDB = 1 << 4 , RZ_OUTPUT_MODE_LONG = 1 << 5 , RZ_OUTPUT_MODE_LONG_JSON = 1 << 6 , RZ_OUTPUT_MODE_TABLE = 1 << 7 ,
  RZ_OUTPUT_MODE_QUIETEST = 1 << 8
}
 Enum to describe the way data are printed. More...
 
enum  RzSysArch {
  RZ_SYS_ARCH_NONE = 0 , RZ_SYS_ARCH_X86 , RZ_SYS_ARCH_ARM , RZ_SYS_ARCH_PPC ,
  RZ_SYS_ARCH_M68K , RZ_SYS_ARCH_JAVA , RZ_SYS_ARCH_MIPS , RZ_SYS_ARCH_SPARC ,
  RZ_SYS_ARCH_XAP , RZ_SYS_ARCH_MSIL , RZ_SYS_ARCH_OBJD , RZ_SYS_ARCH_BF ,
  RZ_SYS_ARCH_SH , RZ_SYS_ARCH_AVR , RZ_SYS_ARCH_DALVIK , RZ_SYS_ARCH_Z80 ,
  RZ_SYS_ARCH_ARC , RZ_SYS_ARCH_I8080 , RZ_SYS_ARCH_RAR , RZ_SYS_ARCH_8051 ,
  RZ_SYS_ARCH_TMS320 , RZ_SYS_ARCH_EBC , RZ_SYS_ARCH_H8300 , RZ_SYS_ARCH_CR16 ,
  RZ_SYS_ARCH_V850 , RZ_SYS_ARCH_SYSZ , RZ_SYS_ARCH_XCORE , RZ_SYS_ARCH_PROPELLER ,
  RZ_SYS_ARCH_MSP430 , RZ_SYS_ARCH_CRIS , RZ_SYS_ARCH_HPPA , RZ_SYS_ARCH_V810 ,
  RZ_SYS_ARCH_LM32 , RZ_SYS_ARCH_RISCV
}
 

Functions

static void * rz_new_copy (int size, void *data)
 
static void rz_run_call1 (void *fcn, void *arg1)
 
static void rz_run_call2 (void *fcn, void *arg1, void *arg2)
 
static void rz_run_call3 (void *fcn, void *arg1, void *arg2, void *arg3)
 
static void rz_run_call4 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4)
 
static void rz_run_call5 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5)
 
static void rz_run_call6 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6)
 
static void rz_run_call7 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7)
 
static void rz_run_call8 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8)
 
static void rz_run_call9 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9)
 
static void rz_run_call10 (void *fcn, void *arg1, void *arg2, void *arg3, void *arg4, void *arg5, void *arg6, void *arg7, void *arg8, void *arg9, void *arg10)
 

Macro Definition Documentation

◆ __KFBSD__

#define __KFBSD__   0

Definition at line 131 of file rz_types.h.

◆ __packed

#define __packed   __attribute__((__packed__))

Definition at line 230 of file rz_types.h.

◆ _FILE_OFFSET_BITS

#define _FILE_OFFSET_BITS   64

Definition at line 5 of file rz_types.h.

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 199 of file rz_types.h.

◆ BITS2BYTES

#define BITS2BYTES (   x)    (((x) / 8) + (((x) % 8) ? 1 : 0))

Definition at line 280 of file rz_types.h.

◆ container_of

#define container_of (   ptr,
  type,
  member 
)    ((type *)((char *)(__typeof__(((type *)0)->member) *){ ptr } - offsetof(type, member)))

Definition at line 650 of file rz_types.h.

◆ CTA

#define CTA (   x,
  y,
 
)    (x + CTO(y, z))

Definition at line 237 of file rz_types.h.

◆ CTI

#define CTI (   x,
  y,
 
)    (*((size_t *)(CTA(x, y, z))))

Definition at line 238 of file rz_types.h.

◆ CTO

#define CTO (   y,
 
)    ((size_t) & ((y *)0)->z)

Definition at line 236 of file rz_types.h.

◆ CTS

#define CTS (   x,
  y,
  z,
  t,
  v 
)
Value:
{ \
t *_ = (t *)CTA(x, y, z); \
*_ = v; \
}
const char * v
Definition: dsignal.c:12
int x
Definition: mipsasm.c:20
#define _(String)
Definition: opintl.h:53
#define CTA(x, y, z)
Definition: rz_types.h:237

Definition at line 239 of file rz_types.h.

◆ eprintf

#define eprintf (   ...)    fprintf(stderr, __VA_ARGS__)

Definition at line 349 of file rz_types.h.

◆ FUNC_ATTR_ALLOC_ALIGN

#define FUNC_ATTR_ALLOC_ALIGN (   x)

Definition at line 180 of file rz_types.h.

◆ FUNC_ATTR_ALLOC_SIZE

#define FUNC_ATTR_ALLOC_SIZE (   x)

Definition at line 178 of file rz_types.h.

◆ FUNC_ATTR_ALLOC_SIZE_PROD

#define FUNC_ATTR_ALLOC_SIZE_PROD (   x,
 
)

Definition at line 179 of file rz_types.h.

◆ FUNC_ATTR_ALWAYS_INLINE

#define FUNC_ATTR_ALWAYS_INLINE

Definition at line 185 of file rz_types.h.

◆ FUNC_ATTR_CONST

#define FUNC_ATTR_CONST

Definition at line 182 of file rz_types.h.

◆ FUNC_ATTR_MALLOC

#define FUNC_ATTR_MALLOC

Definition at line 177 of file rz_types.h.

◆ FUNC_ATTR_PURE

#define FUNC_ATTR_PURE

Definition at line 181 of file rz_types.h.

◆ FUNC_ATTR_USED

#define FUNC_ATTR_USED

Definition at line 183 of file rz_types.h.

◆ FUNC_ATTR_WARN_UNUSED_RESULT

#define FUNC_ATTR_WARN_UNUSED_RESULT

Definition at line 184 of file rz_types.h.

◆ HAVE_EPRINTF

#define HAVE_EPRINTF   1

Definition at line 350 of file rz_types.h.

◆ HHXFMT

#define HHXFMT   "hhx"

Definition at line 402 of file rz_types.h.

◆ LDBLFMT

#define LDBLFMT   "Lf"

Definition at line 401 of file rz_types.h.

◆ O_BINARY

#define O_BINARY   0

Definition at line 413 of file rz_types.h.

◆ PERROR_WITH_FILELINE

#define PERROR_WITH_FILELINE   0

Definition at line 323 of file rz_types.h.

◆ PFMT32d

#define PFMT32d   "d"

Definition at line 408 of file rz_types.h.

◆ PFMT32o

#define PFMT32o   "o"

Definition at line 410 of file rz_types.h.

◆ PFMT32u

#define PFMT32u   "u"

Definition at line 409 of file rz_types.h.

◆ PFMT32x

#define PFMT32x   "x"

Definition at line 407 of file rz_types.h.

◆ PFMT64d

#define PFMT64d   "lld"

Definition at line 394 of file rz_types.h.

◆ PFMT64o

#define PFMT64o   "llo"

Definition at line 396 of file rz_types.h.

◆ PFMT64u

#define PFMT64u   "llu"

Definition at line 395 of file rz_types.h.

◆ PFMT64x

#define PFMT64x   "llx"

Definition at line 393 of file rz_types.h.

◆ PFMTDPTR

#define PFMTDPTR   "td"

Definition at line 405 of file rz_types.h.

◆ PFMTSZd

#define PFMTSZd   "zd"

Definition at line 398 of file rz_types.h.

◆ PFMTSZo

#define PFMTSZo   "zo"

Definition at line 400 of file rz_types.h.

◆ PFMTSZu

#define PFMTSZu   "zu"

Definition at line 399 of file rz_types.h.

◆ PFMTSZx

#define PFMTSZx   "zx"

Definition at line 397 of file rz_types.h.

◆ RZ_API

#define RZ_API

Definition at line 269 of file rz_types.h.

◆ RZ_ARRAY_SIZE

#define RZ_ARRAY_SIZE (   x)    (sizeof(x) / sizeof((x)[0]))

Definition at line 300 of file rz_types.h.

◆ RZ_BIT_CHK

#define RZ_BIT_CHK (   x,
 
)    (*(x) & (1 << (y)))

Definition at line 316 of file rz_types.h.

◆ RZ_BIT_MASK32

#define RZ_BIT_MASK32 (   x,
 
)    ((1UL << (x)) - (1UL << (y)))

Definition at line 310 of file rz_types.h.

◆ RZ_BIT_SET

#define RZ_BIT_SET (   x,
 
)    (((ut8 *)x)[y >> 4] |= (1 << (y & 0xf)))

Definition at line 311 of file rz_types.h.

◆ RZ_BIT_TOGGLE

#define RZ_BIT_TOGGLE (   x,
 
)    (RZ_BIT_CHK(x, y) ? RZ_BIT_UNSET(x, y) : RZ_BIT_SET(x, y))

Definition at line 313 of file rz_types.h.

◆ RZ_BIT_UNSET

#define RZ_BIT_UNSET (   x,
 
)    (((ut8 *)x)[y >> 4] &= ~(1 << (y & 0xf)))

Definition at line 312 of file rz_types.h.

◆ RZ_BORROW

#define RZ_BORROW   /* pointer ownership is not transferred, it must not be freed by the receiver */

Definition at line 63 of file rz_types.h.

◆ RZ_DEPRECATE

#define RZ_DEPRECATE   /* should not be used in new code and should/will be removed in the future */

Definition at line 66 of file rz_types.h.

◆ RZ_FREE

#define RZ_FREE (   x)
Value:
{ \
free((void *)x); \
x = NULL; \
}
#define NULL
Definition: cris-opc.c:27

Definition at line 369 of file rz_types.h.

◆ RZ_FREE_CUSTOM

#define RZ_FREE_CUSTOM (   x,
 
)
Value:
{ \
y(x); \
x = NULL; \
}

Definition at line 375 of file rz_types.h.

◆ RZ_HEAP

#define RZ_HEAP

Definition at line 254 of file rz_types.h.

◆ RZ_IFNULL

#define RZ_IFNULL (   x)    /* default value for the pointer when null */

Definition at line 69 of file rz_types.h.

◆ RZ_IN

#define RZ_IN   /* do not use, implicit */

Definition at line 50 of file rz_types.h.

◆ RZ_INOUT

#define RZ_INOUT   /* parameter is read and written */

Definition at line 52 of file rz_types.h.

◆ RZ_IPI

#define RZ_IPI

Definition at line 249 of file rz_types.h.

◆ RZ_JOIN_2_PATHS

#define RZ_JOIN_2_PATHS (   p1,
  p2 
)    p1 RZ_SYS_DIR p2

Definition at line 224 of file rz_types.h.

◆ RZ_JOIN_3_PATHS

#define RZ_JOIN_3_PATHS (   p1,
  p2,
  p3 
)    p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3

Definition at line 225 of file rz_types.h.

◆ RZ_JOIN_4_PATHS

#define RZ_JOIN_4_PATHS (   p1,
  p2,
  p3,
  p4 
)    p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4

Definition at line 226 of file rz_types.h.

◆ RZ_JOIN_5_PATHS

#define RZ_JOIN_5_PATHS (   p1,
  p2,
  p3,
  p4,
  p5 
)    p1 RZ_SYS_DIR p2 RZ_SYS_DIR p3 RZ_SYS_DIR p4 RZ_SYS_DIR p5

Definition at line 227 of file rz_types.h.

◆ RZ_LIB_VERSION

#define RZ_LIB_VERSION (   x)
Value:
RZ_API const char *x##_version(void) { \
return "" RZ_VERSION; \
}
#define RZ_API
Definition: rz_types.h:269
#define RZ_VERSION
Definition: rz_version.h:8

Definition at line 275 of file rz_types.h.

◆ RZ_LIB_VERSION_HEADER

#define RZ_LIB_VERSION_HEADER (   x)     RZ_API const char *x##_version(void)

Definition at line 273 of file rz_types.h.

◆ RZ_MEM_ALIGN

#define RZ_MEM_ALIGN (   x)    ((void *)(size_t)(((ut64)(size_t)x) & 0xfffffffffffff000LL))

Definition at line 299 of file rz_types.h.

◆ RZ_MODE_ARRAY

#define RZ_MODE_ARRAY   0x010

Definition at line 30 of file rz_types.h.

◆ RZ_MODE_CLASSDUMP

#define RZ_MODE_CLASSDUMP   0x040

Definition at line 32 of file rz_types.h.

◆ RZ_MODE_EQUAL

#define RZ_MODE_EQUAL   0x080

Definition at line 33 of file rz_types.h.

◆ RZ_MODE_JSON

#define RZ_MODE_JSON   0x008

Definition at line 29 of file rz_types.h.

◆ RZ_MODE_PRINT

#define RZ_MODE_PRINT   0x000

Definition at line 25 of file rz_types.h.

◆ RZ_MODE_RIZINCMD

#define RZ_MODE_RIZINCMD   0x001

Definition at line 26 of file rz_types.h.

◆ RZ_MODE_SET

#define RZ_MODE_SET   0x002

Definition at line 27 of file rz_types.h.

◆ RZ_MODE_SIMPLE

#define RZ_MODE_SIMPLE   0x004

Definition at line 28 of file rz_types.h.

◆ RZ_MODE_SIMPLEST

#define RZ_MODE_SIMPLEST   0x020

Definition at line 31 of file rz_types.h.

◆ RZ_NEW

#define RZ_NEW (   x)    (x *)malloc(sizeof(x))

Definition at line 285 of file rz_types.h.

◆ RZ_NEW0

#define RZ_NEW0 (   x)    (x *)calloc(1, sizeof(x))

Definition at line 284 of file rz_types.h.

◆ RZ_NEW_COPY

#define RZ_NEW_COPY (   x,
 
)
Value:
x = (void *)malloc(sizeof(y)); \
memcpy(x, y, sizeof(y))
void * malloc(size_t size)
Definition: malloc.c:123

Definition at line 296 of file rz_types.h.

◆ RZ_NEWCOPY

#define RZ_NEWCOPY (   x,
 
)    (x *)rz_new_copy(sizeof(x), y)

Definition at line 286 of file rz_types.h.

◆ RZ_NEWS

#define RZ_NEWS (   x,
 
)    (x *)malloc(sizeof(x) * (y))

Definition at line 283 of file rz_types.h.

◆ RZ_NEWS0

#define RZ_NEWS0 (   x,
 
)    (x *)calloc(y, sizeof(x))

Definition at line 282 of file rz_types.h.

◆ RZ_NONNULL

#define RZ_NONNULL   /* pointer can not be null */

Definition at line 64 of file rz_types.h.

◆ RZ_NULLABLE

#define RZ_NULLABLE   /* pointer can be null */

Definition at line 65 of file rz_types.h.

◆ rz_offsetof

#define rz_offsetof (   type,
  member 
)    offsetof(type, member)

Definition at line 360 of file rz_types.h.

◆ RZ_OUT

#define RZ_OUT   /* parameter is written, not read */

Definition at line 51 of file rz_types.h.

◆ RZ_OWN

#define RZ_OWN   /* pointer ownership is transferred */

Definition at line 62 of file rz_types.h.

◆ RZ_PERM_ACCESS

#define RZ_PERM_ACCESS   32

Definition at line 102 of file rz_types.h.

◆ RZ_PERM_CREAT

#define RZ_PERM_CREAT   64

Definition at line 103 of file rz_types.h.

◆ RZ_PERM_PRIV

#define RZ_PERM_PRIV   16

Definition at line 101 of file rz_types.h.

◆ RZ_PERM_R

#define RZ_PERM_R   4

Definition at line 93 of file rz_types.h.

◆ RZ_PERM_RW

#define RZ_PERM_RW   (RZ_PERM_R | RZ_PERM_W)

Definition at line 96 of file rz_types.h.

◆ RZ_PERM_RWX

#define RZ_PERM_RWX   (RZ_PERM_R | RZ_PERM_W | RZ_PERM_X)

Definition at line 98 of file rz_types.h.

◆ RZ_PERM_RX

#define RZ_PERM_RX   (RZ_PERM_R | RZ_PERM_X)

Definition at line 97 of file rz_types.h.

◆ RZ_PERM_SHAR

#define RZ_PERM_SHAR   8

Definition at line 100 of file rz_types.h.

◆ RZ_PERM_W

#define RZ_PERM_W   2

Definition at line 94 of file rz_types.h.

◆ RZ_PERM_WX

#define RZ_PERM_WX   (RZ_PERM_W | RZ_PERM_X)

Definition at line 99 of file rz_types.h.

◆ RZ_PERM_X

#define RZ_PERM_X   1

Definition at line 95 of file rz_types.h.

◆ RZ_PRINTF_CHECK

#define RZ_PRINTF_CHECK (   fmt,
  dots 
)

Definition at line 192 of file rz_types.h.

◆ RZ_PTR_ALIGN

#define RZ_PTR_ALIGN (   v,
 
)     ((char *)(((size_t)(v)) & ~(t - 1)))

Definition at line 305 of file rz_types.h.

◆ RZ_PTR_ALIGN_NEXT

#define RZ_PTR_ALIGN_NEXT (   v,
 
)     ((char *)(((size_t)(v) + (t - 1)) & ~(t - 1)))

Definition at line 307 of file rz_types.h.

◆ RZ_PTR_MOVE

#define RZ_PTR_MOVE (   d,
  s 
)
Value:
d = s; \
s = NULL;
static RzSocket * s
Definition: rtr.c:28
#define d(i)
Definition: sha256.c:44

Definition at line 301 of file rz_types.h.

◆ rz_ref

#define rz_ref (   x)    x->RZ_REF_NAME++;

Definition at line 658 of file rz_types.h.

◆ RZ_REF_FUNCTIONS

#define RZ_REF_FUNCTIONS (   s,
  n 
)
Value:
static inline void n##_ref(s *x) { \
x->RZ_REF_NAME++; \
} \
static inline void n##_unref(s *x) { \
rz_unref(x, n##_free); \
}
int n
Definition: mipsasm.c:19

Definition at line 669 of file rz_types.h.

◆ rz_ref_init

#define rz_ref_init (   x)    x->RZ_REF_NAME = 1

Definition at line 659 of file rz_types.h.

◆ RZ_REF_NAME

#define RZ_REF_NAME   refcount

Definition at line 657 of file rz_types.h.

◆ RZ_REF_TYPE

#define RZ_REF_TYPE   RzRef RZ_REF_NAME

Definition at line 668 of file rz_types.h.

◆ RZ_SYS_ARCH

#define RZ_SYS_ARCH   "unknown"

Definition at line 519 of file rz_types.h.

◆ RZ_SYS_BASE

#define RZ_SYS_BASE   ((ut64)0x8048000)

Definition at line 430 of file rz_types.h.

◆ RZ_SYS_BITS

#define RZ_SYS_BITS   RZ_SYS_BITS_32

Definition at line 520 of file rz_types.h.

◆ RZ_SYS_DIR

#define RZ_SYS_DIR   "/"

Definition at line 218 of file rz_types.h.

◆ RZ_SYS_ENDIAN

#define RZ_SYS_ENDIAN   0

Definition at line 521 of file rz_types.h.

◆ RZ_SYS_ENDIAN_BI

#define RZ_SYS_ENDIAN_BI   3

Definition at line 528 of file rz_types.h.

◆ RZ_SYS_ENDIAN_BIG

#define RZ_SYS_ENDIAN_BIG   2

Definition at line 527 of file rz_types.h.

◆ RZ_SYS_ENDIAN_LITTLE

#define RZ_SYS_ENDIAN_LITTLE   1

Definition at line 526 of file rz_types.h.

◆ RZ_SYS_ENDIAN_NONE

#define RZ_SYS_ENDIAN_NONE   0

Definition at line 525 of file rz_types.h.

◆ RZ_SYS_ENVSEP

#define RZ_SYS_ENVSEP   ":"

Definition at line 219 of file rz_types.h.

◆ RZ_SYS_HOME

#define RZ_SYS_HOME   "HOME"

Definition at line 220 of file rz_types.h.

◆ RZ_SYS_OS

#define RZ_SYS_OS   "unknown"

Definition at line 587 of file rz_types.h.

◆ rz_sys_perror

#define rz_sys_perror (   x)    rz_sys_perror_str(x);

Definition at line 336 of file rz_types.h.

◆ RZ_SYS_TMP

#define RZ_SYS_TMP   "TMPDIR"

Definition at line 221 of file rz_types.h.

◆ rz_unref

#define rz_unref (   x,
  f 
)
Value:
{ \
assert(x->RZ_REF_NAME > 0); \
if (!--(x->RZ_REF_NAME)) { \
f(x); \
} \
}

Definition at line 660 of file rz_types.h.

◆ RZ_UNUSED

#define RZ_UNUSED   /* unused */

Definition at line 73 of file rz_types.h.

◆ RZ_V_NOT

#define RZ_V_NOT (   op,
  fail_ret 
)
Value:
if ((op) == (fail_ret)) \
RZ_LOG_WARN(#op " at %s:%d failed: %s\n", __FILE__, __LINE__, strerror(errno))
Definition: dis.c:32

Definition at line 639 of file rz_types.h.

◆ rz_xfreopen

#define rz_xfreopen (   pathname,
  mode,
  stream 
)    RZ_V_NOT(freopen(pathname, mode, stream), NULL)

Definition at line 644 of file rz_types.h.

◆ rz_xread

#define rz_xread (   fd,
  buf,
  count 
)    RZ_V_NOT(read(fd, buf, count), -1)

Definition at line 643 of file rz_types.h.

◆ rz_xwrite

#define rz_xwrite (   fd,
  buf,
  count 
)    RZ_V_NOT(write(fd, buf, count), -1)

Definition at line 642 of file rz_types.h.

◆ TARGET_OS_IPHONE

#define TARGET_OS_IPHONE   0

Definition at line 163 of file rz_types.h.

◆ typeof

#define typeof (   arg)    __typeof__(arg)

Definition at line 354 of file rz_types.h.

◆ UNUSED_FUNCTION

#define UNUSED_FUNCTION (   x)    UNUSED_##x

Definition at line 117 of file rz_types.h.

◆ ZERO_FILL

#define ZERO_FILL (   x)    memset(&x, 0, sizeof(x))

Definition at line 281 of file rz_types.h.

Typedef Documentation

◆ PrintfCallback

typedef int(* PrintfCallback) (const char *str,...) RZ_PRINTF_CHECK(1

Definition at line 233 of file rz_types.h.

◆ RzRef

typedef int RzRef

Definition at line 655 of file rz_types.h.

Enumeration Type Documentation

◆ RzOutputMode

Enum to describe the way data are printed.

Enumerator
RZ_OUTPUT_MODE_STANDARD 
RZ_OUTPUT_MODE_JSON 
RZ_OUTPUT_MODE_RIZIN 
RZ_OUTPUT_MODE_QUIET 
RZ_OUTPUT_MODE_SDB 
RZ_OUTPUT_MODE_LONG 
RZ_OUTPUT_MODE_LONG_JSON 
RZ_OUTPUT_MODE_TABLE 
RZ_OUTPUT_MODE_QUIETEST 

Definition at line 38 of file rz_types.h.

38  {
39  RZ_OUTPUT_MODE_STANDARD = 1 << 0,
40  RZ_OUTPUT_MODE_JSON = 1 << 1,
41  RZ_OUTPUT_MODE_RIZIN = 1 << 2,
42  RZ_OUTPUT_MODE_QUIET = 1 << 3,
43  RZ_OUTPUT_MODE_SDB = 1 << 4,
44  RZ_OUTPUT_MODE_LONG = 1 << 5,
45  RZ_OUTPUT_MODE_LONG_JSON = 1 << 6,
46  RZ_OUTPUT_MODE_TABLE = 1 << 7,
47  RZ_OUTPUT_MODE_QUIETEST = 1 << 8,
48 } RzOutputMode;
RzOutputMode
Enum to describe the way data are printed.
Definition: rz_types.h:38
@ RZ_OUTPUT_MODE_TABLE
Definition: rz_types.h:46
@ RZ_OUTPUT_MODE_LONG
Definition: rz_types.h:44
@ RZ_OUTPUT_MODE_JSON
Definition: rz_types.h:40
@ RZ_OUTPUT_MODE_QUIET
Definition: rz_types.h:42
@ RZ_OUTPUT_MODE_LONG_JSON
Definition: rz_types.h:45
@ RZ_OUTPUT_MODE_SDB
Definition: rz_types.h:43
@ RZ_OUTPUT_MODE_QUIETEST
Definition: rz_types.h:47
@ RZ_OUTPUT_MODE_RIZIN
Definition: rz_types.h:41
@ RZ_OUTPUT_MODE_STANDARD
Definition: rz_types.h:39

◆ RzSysArch

enum RzSysArch
Enumerator
RZ_SYS_ARCH_NONE 
RZ_SYS_ARCH_X86 
RZ_SYS_ARCH_ARM 
RZ_SYS_ARCH_PPC 
RZ_SYS_ARCH_M68K 
RZ_SYS_ARCH_JAVA 
RZ_SYS_ARCH_MIPS 
RZ_SYS_ARCH_SPARC 
RZ_SYS_ARCH_XAP 
RZ_SYS_ARCH_MSIL 
RZ_SYS_ARCH_OBJD 
RZ_SYS_ARCH_BF 
RZ_SYS_ARCH_SH 
RZ_SYS_ARCH_AVR 
RZ_SYS_ARCH_DALVIK 
RZ_SYS_ARCH_Z80 
RZ_SYS_ARCH_ARC 
RZ_SYS_ARCH_I8080 
RZ_SYS_ARCH_RAR 
RZ_SYS_ARCH_8051 
RZ_SYS_ARCH_TMS320 
RZ_SYS_ARCH_EBC 
RZ_SYS_ARCH_H8300 
RZ_SYS_ARCH_CR16 
RZ_SYS_ARCH_V850 
RZ_SYS_ARCH_SYSZ 
RZ_SYS_ARCH_XCORE 
RZ_SYS_ARCH_PROPELLER 
RZ_SYS_ARCH_MSP430 
RZ_SYS_ARCH_CRIS 
RZ_SYS_ARCH_HPPA 
RZ_SYS_ARCH_V810 
RZ_SYS_ARCH_LM32 
RZ_SYS_ARCH_RISCV 

Definition at line 530 of file rz_types.h.

530  {
531  RZ_SYS_ARCH_NONE = 0,
565 } RzSysArch;
RzSysArch
Definition: rz_types.h:530
@ RZ_SYS_ARCH_PPC
Definition: rz_types.h:534
@ RZ_SYS_ARCH_BF
Definition: rz_types.h:542
@ RZ_SYS_ARCH_XAP
Definition: rz_types.h:539
@ RZ_SYS_ARCH_MIPS
Definition: rz_types.h:537
@ RZ_SYS_ARCH_M68K
Definition: rz_types.h:535
@ RZ_SYS_ARCH_JAVA
Definition: rz_types.h:536
@ RZ_SYS_ARCH_XCORE
Definition: rz_types.h:557
@ RZ_SYS_ARCH_NONE
Definition: rz_types.h:531
@ RZ_SYS_ARCH_RISCV
Definition: rz_types.h:564
@ RZ_SYS_ARCH_ARC
Definition: rz_types.h:547
@ RZ_SYS_ARCH_Z80
Definition: rz_types.h:546
@ RZ_SYS_ARCH_DALVIK
Definition: rz_types.h:545
@ RZ_SYS_ARCH_SH
Definition: rz_types.h:543
@ RZ_SYS_ARCH_HPPA
Definition: rz_types.h:561
@ RZ_SYS_ARCH_MSIL
Definition: rz_types.h:540
@ RZ_SYS_ARCH_OBJD
Definition: rz_types.h:541
@ RZ_SYS_ARCH_MSP430
Definition: rz_types.h:559
@ RZ_SYS_ARCH_I8080
Definition: rz_types.h:548
@ RZ_SYS_ARCH_EBC
Definition: rz_types.h:552
@ RZ_SYS_ARCH_8051
Definition: rz_types.h:550
@ RZ_SYS_ARCH_AVR
Definition: rz_types.h:544
@ RZ_SYS_ARCH_TMS320
Definition: rz_types.h:551
@ RZ_SYS_ARCH_CR16
Definition: rz_types.h:554
@ RZ_SYS_ARCH_V850
Definition: rz_types.h:555
@ RZ_SYS_ARCH_SYSZ
Definition: rz_types.h:556
@ RZ_SYS_ARCH_SPARC
Definition: rz_types.h:538
@ RZ_SYS_ARCH_LM32
Definition: rz_types.h:563
@ RZ_SYS_ARCH_CRIS
Definition: rz_types.h:560
@ RZ_SYS_ARCH_X86
Definition: rz_types.h:532
@ RZ_SYS_ARCH_PROPELLER
Definition: rz_types.h:558
@ RZ_SYS_ARCH_V810
Definition: rz_types.h:562
@ RZ_SYS_ARCH_RAR
Definition: rz_types.h:549
@ RZ_SYS_ARCH_ARM
Definition: rz_types.h:533
@ RZ_SYS_ARCH_H8300
Definition: rz_types.h:553

Function Documentation

◆ rz_new_copy()

static void* rz_new_copy ( int  size,
void *  data 
)
inlinestatic

Definition at line 288 of file rz_types.h.

288  {
289  void *a = malloc(size);
290  if (a) {
291  memcpy(a, data, size);
292  }
293  return a;
294 }
voidpf void uLong size
Definition: ioapi.h:138
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
#define a(i)
Definition: sha256.c:41

References a, malloc(), and memcpy().

◆ rz_run_call1()

static void rz_run_call1 ( void *  fcn,
void *  arg1 
)
inlinestatic

Definition at line 594 of file rz_types.h.

594  {
595  ((void (*)(void *))(fcn))(arg1);
596 }

Referenced by rz_run_start().

◆ rz_run_call10()

static void rz_run_call10 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3,
void *  arg4,
void *  arg5,
void *  arg6,
void *  arg7,
void *  arg8,
void *  arg9,
void *  arg10 
)
inlinestatic

Definition at line 634 of file rz_types.h.

635  {
636  ((void (*)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *))(fcn))(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
637 }

Referenced by rz_run_start().

◆ rz_run_call2()

static void rz_run_call2 ( void *  fcn,
void *  arg1,
void *  arg2 
)
inlinestatic

Definition at line 598 of file rz_types.h.

598  {
599  ((void (*)(void *, void *))(fcn))(arg1, arg2);
600 }

Referenced by rz_run_start().

◆ rz_run_call3()

static void rz_run_call3 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3 
)
inlinestatic

Definition at line 602 of file rz_types.h.

602  {
603  ((void (*)(void *, void *, void *))(fcn))(arg1, arg2, arg3);
604 }

Referenced by rz_run_start().

◆ rz_run_call4()

static void rz_run_call4 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3,
void *  arg4 
)
inlinestatic

Definition at line 606 of file rz_types.h.

606  {
607  ((void (*)(void *, void *, void *, void *))(fcn))(arg1, arg2, arg3, arg4);
608 }

Referenced by rz_run_start().

◆ rz_run_call5()

static void rz_run_call5 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3,
void *  arg4,
void *  arg5 
)
inlinestatic

Definition at line 610 of file rz_types.h.

610  {
611  ((void (*)(void *, void *, void *, void *, void *))(fcn))(arg1, arg2, arg3, arg4, arg5);
612 }

Referenced by rz_run_start().

◆ rz_run_call6()

static void rz_run_call6 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3,
void *  arg4,
void *  arg5,
void *  arg6 
)
inlinestatic

Definition at line 614 of file rz_types.h.

615  {
616  ((void (*)(void *, void *, void *, void *, void *, void *))(fcn))(arg1, arg2, arg3, arg4, arg5, arg6);
617 }

Referenced by rz_run_start().

◆ rz_run_call7()

static void rz_run_call7 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3,
void *  arg4,
void *  arg5,
void *  arg6,
void *  arg7 
)
inlinestatic

Definition at line 619 of file rz_types.h.

620  {
621  ((void (*)(void *, void *, void *, void *, void *, void *, void *))(fcn))(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
622 }

Referenced by rz_run_start().

◆ rz_run_call8()

static void rz_run_call8 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3,
void *  arg4,
void *  arg5,
void *  arg6,
void *  arg7,
void *  arg8 
)
inlinestatic

Definition at line 624 of file rz_types.h.

625  {
626  ((void (*)(void *, void *, void *, void *, void *, void *, void *, void *))(fcn))(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
627 }

Referenced by rz_run_start().

◆ rz_run_call9()

static void rz_run_call9 ( void *  fcn,
void *  arg1,
void *  arg2,
void *  arg3,
void *  arg4,
void *  arg5,
void *  arg6,
void *  arg7,
void *  arg8,
void *  arg9 
)
inlinestatic

Definition at line 629 of file rz_types.h.

630  {
631  ((void (*)(void *, void *, void *, void *, void *, void *, void *, void *, void *))(fcn))(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
632 }

Referenced by rz_run_start().