Rizin
unix-like reverse engineering framework and cli tools
utils.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2016 madprogrammer
2 // SPDX-License-Identifier: GPL-2.0-only
3 
5 #ifndef UTILS_H
6 #define UTILS_H
7 
8 #include <stdint.h>
9 #include <stdio.h>
10 #include "libqnxr.h"
11 #include "gdb_signals.h"
12 
13 #define LONGEST st64
14 #define ULONGEST ut64
15 
16 #ifndef ARRAY_SIZE
17 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
18 #endif
19 
20 #define EXTRACT_SIGNED_INTEGER(addr, len) \
21  extract_signed_integer((const ut8 *)addr, len, 0)
22 #define EXTRACT_UNSIGNED_INTEGER(addr, len) \
23  extract_unsigned_integer((const ut8 *)addr, len, 0)
24 
25 int errnoconvert(int x);
26 
28 
29 LONGEST extract_signed_integer(const ut8 *addr, int len, int be);
30 ULONGEST extract_unsigned_integer(const ut8 *addr, int len, int be);
31 
32 int i386nto_regset_id(int regno);
33 int i386nto_reg_offset(int regnum);
34 int i386nto_register_area(int regno, int regset, unsigned *off);
35 
37 
38 #endif
size_t len
Definition: 6502dis.c:15
target_signal
Definition: gdb_signals.h:54
uint8_t ut8
Definition: lh5801.h:11
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc pid
Definition: sflib.h:64
int x
Definition: mipsasm.c:20
int off
Definition: pal.c:13
#define st64
Definition: rz_types_base.h:10
#define st32
Definition: rz_types_base.h:12
Definition: libqnxr.h:30
int i386nto_reg_offset(int regnum)
Definition: utils.c:204
int i386nto_regset_id(int regno)
Definition: utils.c:191
#define ULONGEST
Definition: utils.h:14
int i386nto_register_area(int regno, int regset, unsigned *off)
int errnoconvert(int x)
Definition: utils.c:131
ptid_t ptid_build(st32 pid, st64 tid)
Definition: utils.c:301
LONGEST extract_signed_integer(const ut8 *addr, int len, int be)
Definition: utils.c:137
#define LONGEST
Definition: utils.h:13
ULONGEST extract_unsigned_integer(const ut8 *addr, int len, int be)
Definition: utils.c:167
enum target_signal target_signal_from_nto(int sig)
Definition: sigutil.c:596
static int addr
Definition: z80asm.c:58