mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-21 14:50:49 +00:00
Meson: some cleanup (#10076)
This commit is contained in:
parent
338dc2c206
commit
7e9f982849
@ -1,7 +1,6 @@
|
||||
files = [
|
||||
'anal.c',
|
||||
'anal_ex.c',
|
||||
#'arch/gb/meta_gb_cmt.c',
|
||||
'bb.c',
|
||||
'cc.c',
|
||||
'cond.c',
|
||||
@ -18,6 +17,20 @@ files = [
|
||||
'labels.c',
|
||||
'meta.c',
|
||||
'op.c',
|
||||
'pin.c',
|
||||
'reflines.c',
|
||||
'rtti.c',
|
||||
'rtti_msvc.c',
|
||||
'rtti_itanium.c',
|
||||
'session.c',
|
||||
'sign.c',
|
||||
'state.c',
|
||||
'switch.c',
|
||||
'types.c',
|
||||
'value.c',
|
||||
'var.c',
|
||||
'vtable.c',
|
||||
'xrefs.c',
|
||||
'p/anal_6502.c',
|
||||
'p/anal_8051.c',
|
||||
'p/anal_arc.c',
|
||||
@ -25,6 +38,7 @@ files = [
|
||||
'p/anal_arm_gnu.c',
|
||||
'p/anal_avr.c',
|
||||
'p/anal_bf.c',
|
||||
'p/anal_chip8.c',
|
||||
'p/anal_cr16.c',
|
||||
'p/anal_cris.c',
|
||||
'p/anal_dalvik.c',
|
||||
@ -47,7 +61,7 @@ files = [
|
||||
'p/anal_ppc_gnu.c',
|
||||
'p/anal_propeller.c',
|
||||
'p/anal_riscv.c',
|
||||
#'p/anal_rsp.c',
|
||||
'p/anal_rsp.c',
|
||||
'p/anal_sh.c',
|
||||
'p/anal_snes.c',
|
||||
'p/anal_sparc_cs.c',
|
||||
@ -59,37 +73,25 @@ files = [
|
||||
'p/anal_v810.c',
|
||||
'p/anal_v850.c',
|
||||
'p/anal_vax.c',
|
||||
'p/anal_wasm.c',
|
||||
'p/anal_ws.c',
|
||||
'p/anal_x86_cs.c',
|
||||
'p/anal_xap.c',
|
||||
'p/anal_xcore_cs.c',
|
||||
'p/anal_xtensa.c',
|
||||
'p/anal_z80.c',
|
||||
'pin.c',
|
||||
'reflines.c',
|
||||
'rtti.c',
|
||||
'rtti_msvc.c',
|
||||
'rtti_itanium.c',
|
||||
'session.c',
|
||||
'sign.c',
|
||||
'state.c',
|
||||
'switch.c',
|
||||
# 'test.c',
|
||||
'types.c',
|
||||
'value.c',
|
||||
'var.c',
|
||||
'vtable.c',
|
||||
'xrefs.c',
|
||||
#'arch/gb/meta_gb_cmt.c',
|
||||
'arch/hexagon/hexagon_anal.c',
|
||||
'../asm/arch/hexagon/hexagon.c',
|
||||
'../asm/arch/hexagon/hexagon_disas.c',
|
||||
'../asm/arch/arm/winedbg/be_arm.c',
|
||||
'../asm/arch/cr16/cr16_disas.c',
|
||||
'../asm/arch/ebc/ebc_disas.c',
|
||||
'../asm/arch/h8300/h8300_disas.c',
|
||||
'../asm/arch/hexagon/hexagon.c',
|
||||
'../asm/arch/hexagon/hexagon_disas.c',
|
||||
'../asm/arch/msp430/msp430_disas.c',
|
||||
'../asm/arch/ppc/libvle/vle.c',
|
||||
'../asm/arch/propeller/propeller_disas.c',
|
||||
'../asm/arch/rsp/rsp_idec.c',
|
||||
'../asm/arch/tms320/tms320_dasm.c',
|
||||
'../asm/arch/tms320/c55x_plus/ins.c',
|
||||
'../asm/arch/tms320/c55x_plus/c55plus.c',
|
||||
@ -99,6 +101,7 @@ files = [
|
||||
'../asm/arch/tms320/c55x_plus/utils.c',
|
||||
'../asm/arch/v810/v810_disas.c',
|
||||
'../asm/arch/v850/v850_disas.c',
|
||||
'../asm/arch/wasm/wasm.c',
|
||||
'../asm/arch/xtensa/gnu/xtensa-dis.c',
|
||||
'../asm/arch/xtensa/gnu/elf32-xtensa.c',
|
||||
'../asm/arch/xtensa/gnu/xtensa-isa.c',
|
||||
@ -108,27 +111,36 @@ files = [
|
||||
r_anal = library('r_anal', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'arch/gb',
|
||||
'arch/hexagon',
|
||||
'../asm/arch/8051',
|
||||
'../asm/arch/cr16',
|
||||
'../asm/arch/ebc',
|
||||
'../asm/arch/h8300',
|
||||
'../asm/arch/hexagon',
|
||||
'../anal/arch/hexagon',
|
||||
'../asm/arch/msp430',
|
||||
'../asm/arch/propeller',
|
||||
'../asm/arch/rsp',
|
||||
'../asm/arch/tms320',
|
||||
'../asm/arch/v810',
|
||||
'../asm/arch/v850',
|
||||
'../asm/arch/wasm',
|
||||
'../asm/arch/include/',
|
||||
'../../shlr/capstone/include',
|
||||
'../../shlr'
|
||||
])
|
||||
)
|
||||
],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [
|
||||
r_util, r_reg, r_asm, r_syscall, r_search, r_cons, r_flag, libr_shlr
|
||||
r_util,
|
||||
r_reg,
|
||||
r_asm,
|
||||
r_syscall,
|
||||
r_search,
|
||||
r_cons,
|
||||
r_flag,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
@ -142,7 +154,13 @@ pkgconfig_mod.generate(
|
||||
name: 'r_anal',
|
||||
filebase: 'r_anal',
|
||||
requires: [
|
||||
'r_util', 'r_reg', 'r_asm', 'r_syscall', 'r_search', 'r_cons', 'r_flag'
|
||||
'r_util',
|
||||
'r_reg',
|
||||
'r_asm',
|
||||
'r_syscall',
|
||||
'r_search',
|
||||
'r_cons',
|
||||
'r_flag'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -10,22 +10,24 @@ files = [
|
||||
'p/asm_arm_winedbg.c',
|
||||
'p/asm_avr.c',
|
||||
'p/asm_bf.c',
|
||||
'p/asm_chip8.c',
|
||||
'p/asm_cr16.c',
|
||||
'p/asm_cris_gnu.c',
|
||||
'p/asm_dalvik.c',
|
||||
'p/asm_dcpu16.c',
|
||||
'p/asm_ebc.c',
|
||||
'p/asm_gas.c',
|
||||
#'p/asm_gas.c',
|
||||
'p/asm_gb.c',
|
||||
'p/asm_h8300.c',
|
||||
'p/asm_hexagon.c',
|
||||
#'p/asm_hexagon_gnu.c',
|
||||
'p/asm_hppa_gnu.c',
|
||||
'p/asm_i4004.c',
|
||||
'p/asm_i8080.c',
|
||||
'p/asm_java.c',
|
||||
'p/asm_lanai_gnu.c',
|
||||
'p/asm_lm32.c',
|
||||
'p/asm_lh5801.c',
|
||||
'p/asm_lm32.c',
|
||||
'p/asm_m68k_cs.c',
|
||||
'p/asm_malbolge.c',
|
||||
'p/asm_mcs96.c',
|
||||
@ -57,6 +59,7 @@ files = [
|
||||
'p/asm_x86_cs.c',
|
||||
'p/asm_x86_nasm.c',
|
||||
'p/asm_x86_nz.c',
|
||||
#'p/asm_x86_vm.c',
|
||||
'p/asm_xap.c',
|
||||
'p/asm_xcore_cs.c',
|
||||
'p/asm_xtensa.c',
|
||||
@ -90,6 +93,9 @@ files = [
|
||||
'arch/h8300/h8300_disas.c',
|
||||
'arch/hexagon/hexagon.c',
|
||||
'arch/hexagon/hexagon_disas.c',
|
||||
#'arch/hexagon/gnu/hexagon-dis.c',
|
||||
#'arch/hexagon/gnu/hexagon-opc.c',
|
||||
#'arch/hexagon/gnu/safe-ctype.c',
|
||||
'arch/hppa/gnu/hppa-dis.c',
|
||||
'arch/i4004/i4004dis.c',
|
||||
'arch/i8080/i8080dis.c',
|
||||
@ -146,7 +152,7 @@ files = [
|
||||
r_asm = library('r_asm', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'../../shlr/capstone/include',
|
||||
'../../shlr',
|
||||
'arch/include',
|
||||
@ -160,11 +166,17 @@ r_asm = library('r_asm', files,
|
||||
'arch/ebc',
|
||||
'arch/cr16',
|
||||
'arch/8051',
|
||||
])
|
||||
)
|
||||
],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [
|
||||
r_util, r_syscall, r_parse, r_lang, r_flag, r_socket, libr_shlr
|
||||
r_util,
|
||||
r_syscall,
|
||||
r_parse,
|
||||
r_lang,
|
||||
r_flag,
|
||||
r_socket,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
@ -178,7 +190,12 @@ pkgconfig_mod.generate(
|
||||
name: 'r_asm',
|
||||
filebase: 'r_asm',
|
||||
requires: [
|
||||
'r_util', 'r_syscall', 'r_parse', 'r_lang', 'r_flag', 'r_socket'
|
||||
'r_util',
|
||||
'r_syscall',
|
||||
'r_parse',
|
||||
'r_lang',
|
||||
'r_flag',
|
||||
'r_socket'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -26,11 +26,12 @@ files = [
|
||||
'p/bin_elf64.c',
|
||||
'p/bin_fs.c',
|
||||
'p/bin_java.c',
|
||||
'p/bin_ldr_linux.c',
|
||||
'p/bin_mach0.c',
|
||||
'p/bin_mach064.c',
|
||||
'p/bin_mbn.c',
|
||||
'p/bin_menuet.c',
|
||||
'p/bin_mdmp.c',
|
||||
'p/bin_menuet.c',
|
||||
'p/bin_mz.c',
|
||||
'p/bin_nes.c',
|
||||
'p/bin_nin3ds.c',
|
||||
@ -38,6 +39,7 @@ files = [
|
||||
'p/bin_ningb.c',
|
||||
'p/bin_ningba.c',
|
||||
'p/bin_nro.c',
|
||||
'p/bin_nso.c',
|
||||
'p/bin_omf.c',
|
||||
'p/bin_p9.c',
|
||||
'p/bin_pe.c',
|
||||
@ -60,8 +62,8 @@ files = [
|
||||
'p/bin_xbe.c',
|
||||
'p/bin_xtr_dyldcache.c',
|
||||
'p/bin_xtr_fatmach0.c',
|
||||
'p/bin_zimg.c',
|
||||
'p/bin_z64.c',
|
||||
'p/bin_zimg.c',
|
||||
|
||||
'format/bflt/bflt.c',
|
||||
'format/coff/coff.c',
|
||||
@ -115,13 +117,19 @@ files = [
|
||||
r_bin = library('r_bin', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'mangling',
|
||||
'format'
|
||||
])
|
||||
)
|
||||
],
|
||||
c_args: ['-DCORELIB=1', '-DR_API_BIN_ONLY=1'],
|
||||
link_with: [r_util, r_io, r_socket, r_magic, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
r_io,
|
||||
r_socket,
|
||||
r_magic,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
@ -134,7 +142,10 @@ pkgconfig_mod.generate(
|
||||
name: 'r_bin',
|
||||
filebase: 'r_bin',
|
||||
requires: [
|
||||
'r_util', 'r_io', 'r_socket', 'r_magic'
|
||||
'r_util',
|
||||
'r_io',
|
||||
'r_socket',
|
||||
'r_magic'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -284,7 +284,7 @@ RList *mem (RBinFile *bf) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct r_bin_plugin_t r_bin_plugin_ningb = {
|
||||
RBinPlugin r_bin_plugin_ningb = {
|
||||
.name = "ningb",
|
||||
.desc = "Gameboy format r_bin plugin",
|
||||
.license = "LGPL3",
|
||||
|
@ -224,7 +224,7 @@ static RBuffer *create(RBin *bin, const ut8 *code, int codelen, const ut8 *data,
|
||||
return buf;
|
||||
}
|
||||
|
||||
struct r_bin_plugin_t r_bin_plugin_p9 = {
|
||||
RBinPlugin r_bin_plugin_p9 = {
|
||||
.name = "p9",
|
||||
.desc = "Plan9 bin plugin",
|
||||
.license = "LGPL3",
|
||||
|
@ -184,7 +184,7 @@ static RList* entries(RBinFile *bf) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct r_bin_plugin_t r_bin_plugin_pebble = {
|
||||
RBinPlugin r_bin_plugin_pebble = {
|
||||
.name = "pebble",
|
||||
.desc = "Pebble Watch App",
|
||||
.license = "LGPL",
|
||||
|
@ -538,7 +538,7 @@ static RList* entries(RBinFile *bf) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct r_bin_plugin_t r_bin_plugin_vsf = {
|
||||
RBinPlugin r_bin_plugin_vsf = {
|
||||
.name = "vsf",
|
||||
.desc = "VICE Snapshot File",
|
||||
.license = "LGPL3",
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
#define R_EGG_STATIC_PLUGINS @plugins_egg@
|
||||
#define R_BIN_STATIC_PLUGINS @plugins_bin@
|
||||
#define R_BIN_LDR_STATIC_PLUGINS @plugins_bin_ldr@
|
||||
#define R_BIN_XTR_STATIC_PLUGINS @plugins_bin_xtr@
|
||||
#define R_FS_STATIC_PLUGINS @plugins_fs@
|
||||
#define R_IO_STATIC_PLUGINS @plugins_io@
|
||||
#define R_DEBUG_STATIC_PLUGINS @plugins_debug@
|
||||
|
@ -5,7 +5,10 @@ files = [
|
||||
|
||||
r_config = library('r_config', files,
|
||||
include_directories: [platform_inc],
|
||||
link_with: [r_util, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
|
@ -19,7 +19,10 @@ files = [
|
||||
|
||||
r_cons = library('r_cons', files,
|
||||
include_directories: [platform_inc],
|
||||
link_with: [r_util, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
|
@ -1,7 +1,6 @@
|
||||
files = [
|
||||
'anal_tp.c',
|
||||
'asm.c',
|
||||
'p/core_anal.c',
|
||||
'blaze.c',
|
||||
'canal.c',
|
||||
'carg.c',
|
||||
@ -57,7 +56,9 @@ files = [
|
||||
'visual.c',
|
||||
'vmarks.c',
|
||||
'vmenus.c',
|
||||
'yank.c'
|
||||
'yank.c',
|
||||
'p/core_anal.c',
|
||||
'p/core_java.c',
|
||||
]
|
||||
|
||||
|
||||
@ -73,9 +74,28 @@ r_core = library('r_core', files,
|
||||
],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [
|
||||
r_util, r_reg, r_syscall, r_search, r_cons, r_anal, r_socket, r_io, r_fs,
|
||||
r_lang, r_hash, r_flag, r_parse, r_egg, r_debug, r_magic, r_crypto, r_config,
|
||||
r_bin, r_asm, r_bp, libr_shlr
|
||||
r_util,
|
||||
r_reg,
|
||||
r_syscall,
|
||||
r_search,
|
||||
r_cons,
|
||||
r_anal,
|
||||
r_socket,
|
||||
r_io,
|
||||
r_fs,
|
||||
r_lang,
|
||||
r_hash,
|
||||
r_flag,
|
||||
r_parse,
|
||||
r_egg,
|
||||
r_debug,
|
||||
r_magic,
|
||||
r_crypto,
|
||||
r_config,
|
||||
r_bin,
|
||||
r_asm,
|
||||
r_bp,
|
||||
libr_shlr
|
||||
],
|
||||
dependencies: [platform_deps],
|
||||
install: true,
|
||||
@ -90,9 +110,27 @@ pkgconfig_mod.generate(
|
||||
name: 'r_core',
|
||||
filebase: 'r_core',
|
||||
requires: [
|
||||
'r_util', 'r_reg', 'r_syscall', 'r_search', 'r_cons', 'r_anal', 'r_socket', 'r_io', 'r_fs',
|
||||
'r_lang', 'r_hash', 'r_flag', 'r_parse', 'r_egg', 'r_debug', 'r_magic', 'r_crypto', 'r_config',
|
||||
'r_bin', 'r_asm', 'r_bp'
|
||||
'r_util',
|
||||
'r_reg',
|
||||
'r_syscall',
|
||||
'r_search',
|
||||
'r_cons',
|
||||
'r_anal',
|
||||
'r_socket',
|
||||
'r_io',
|
||||
'r_fs',
|
||||
'r_lang',
|
||||
'r_hash',
|
||||
'r_flag',
|
||||
'r_parse',
|
||||
'r_egg',
|
||||
'r_debug',
|
||||
'r_magic',
|
||||
'r_crypto',
|
||||
'r_config',
|
||||
'r_bin',
|
||||
'r_asm',
|
||||
'r_bp'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -15,9 +15,9 @@ files = [
|
||||
'p/crypto_rol.c',
|
||||
'p/crypto_ror.c',
|
||||
'p/crypto_rot.c',
|
||||
'p/crypto_xor.c',
|
||||
'p/crypto_serpent.c',
|
||||
'p/crypto_serpent_algo.c',
|
||||
'p/crypto_xor.c',
|
||||
]
|
||||
|
||||
r_crypto = library('r_crypto', files,
|
||||
@ -29,13 +29,14 @@ r_crypto = library('r_crypto', files,
|
||||
soversion: r2_libversion
|
||||
)
|
||||
|
||||
pkg = import('pkgconfig')
|
||||
pkg.generate(libraries: [r_crypto],
|
||||
subdirs: 'libr',
|
||||
version: r2_version,
|
||||
name: 'r_crypto',
|
||||
filebase: 'r_crypto',
|
||||
requires: [
|
||||
'r_util'
|
||||
],
|
||||
description: 'radare foundation libraries')
|
||||
pkgconfig_mod.generate(
|
||||
libraries: [r_crypto],
|
||||
subdirs: 'libr',
|
||||
version: r2_version,
|
||||
name: 'r_crypto',
|
||||
filebase: 'r_crypto',
|
||||
requires: [
|
||||
'r_util'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -5,14 +5,21 @@ files = [
|
||||
'dreg.c',
|
||||
'esil.c',
|
||||
'map.c',
|
||||
'pid.c',
|
||||
'plugin.c',
|
||||
'session.c',
|
||||
'signal.c',
|
||||
'snap.c',
|
||||
'trace.c',
|
||||
'p/bfvm.c',
|
||||
'p/debug_bf.c',
|
||||
#'p/debug_bochs.c',
|
||||
'p/debug_bochs.c',
|
||||
'p/debug_esil.c',
|
||||
'p/debug_gdb.c',
|
||||
'p/debug_io.c',
|
||||
'p/debug_native.c',
|
||||
#'p/debug_qnx.c',
|
||||
'p/debug_null.c',
|
||||
'p/debug_qnx.c',
|
||||
'p/debug_rap.c',
|
||||
'p/debug_windbg.c',
|
||||
#'p/native/arm.c',
|
||||
@ -23,12 +30,6 @@ files = [
|
||||
#'p/native/darwin.c',
|
||||
#'p/native/drx.c',
|
||||
#'p/native/maps/darwin.c',
|
||||
'pid.c',
|
||||
'plugin.c',
|
||||
'session.c',
|
||||
'signal.c',
|
||||
'snap.c',
|
||||
'trace.c',
|
||||
]
|
||||
|
||||
if host_machine.system() == 'linux'
|
||||
@ -57,16 +58,30 @@ endif
|
||||
r_debug = library('r_debug', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'../bin/format/elf',
|
||||
'../../shlr/gdb/include',
|
||||
'../../shlr/qnx/include',
|
||||
'../../shlr/bochs/include',
|
||||
'../../shlr/windbg'
|
||||
])
|
||||
)
|
||||
],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [
|
||||
r_util, r_hash, r_reg, r_syscall, r_anal, r_flag, r_io, r_bp, r_search,
|
||||
r_cons, r_lang, r_egg, r_socket, libr_shlr
|
||||
r_util,
|
||||
r_hash,
|
||||
r_reg,
|
||||
r_syscall,
|
||||
r_anal,
|
||||
r_flag,
|
||||
r_io,
|
||||
r_bp,
|
||||
r_search,
|
||||
r_cons,
|
||||
r_lang,
|
||||
r_egg,
|
||||
r_socket,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
@ -80,8 +95,19 @@ pkgconfig_mod.generate(
|
||||
name: 'r_debug',
|
||||
filebase: 'r_debug',
|
||||
requires: [
|
||||
'r_util', 'r_hash', 'r_reg', 'r_syscall', 'r_anal', 'r_flag', 'r_io', 'r_bp', 'r_search',
|
||||
'r_cons', 'r_lang', 'r_egg', 'r_socket'
|
||||
'r_util',
|
||||
'r_hash',
|
||||
'r_reg',
|
||||
'r_syscall',
|
||||
'r_anal',
|
||||
'r_flag',
|
||||
'r_io',
|
||||
'r_bp',
|
||||
'r_search',
|
||||
'r_cons',
|
||||
'r_lang',
|
||||
'r_egg',
|
||||
'r_socket'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -6,7 +6,6 @@ files = [
|
||||
'emit_trace.c',
|
||||
'emit_x64.c',
|
||||
'emit_x86.c',
|
||||
|
||||
#'p/egg_bind.c',
|
||||
#'p/egg_cb.c',
|
||||
'p/egg_exec.c',
|
||||
@ -18,7 +17,12 @@ files = [
|
||||
r_egg = library('r_egg', files,
|
||||
include_directories: [platform_inc],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [r_util, r_asm, r_syscall, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
r_asm,
|
||||
r_syscall,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
@ -31,7 +35,9 @@ pkgconfig_mod.generate(
|
||||
name: 'r_egg',
|
||||
filebase: 'r_egg',
|
||||
requires: [
|
||||
'r_util', 'r_asm', 'r_syscall'
|
||||
'r_util',
|
||||
'r_asm',
|
||||
'r_syscall'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -8,7 +8,10 @@ files = [
|
||||
|
||||
r_flag = library('r_flag', files,
|
||||
include_directories: [platform_inc],
|
||||
link_with: [r_util, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
|
@ -2,18 +2,20 @@ files = [
|
||||
'file.c',
|
||||
'fs.c',
|
||||
'shell.c',
|
||||
#'p/fs_cpio.c',
|
||||
'p/fs_cpio.c',
|
||||
'p/fs_ext2.c',
|
||||
'p/fs_fat.c',
|
||||
'p/fs_fb.c',
|
||||
#'p/fs_grub_base.c',
|
||||
'p/fs_hfs.c',
|
||||
'p/fs_hfsplus.c',
|
||||
'p/fs_io.c',
|
||||
'p/fs_iso9660.c',
|
||||
'p/fs_jfs.c',
|
||||
'p/fs_minix.c',
|
||||
'p/fs_ntfs.c',
|
||||
'p/fs_posix.c',
|
||||
'p/fs_r2.c',
|
||||
'p/fs_reiserfs.c',
|
||||
'p/fs_sfs.c',
|
||||
'p/fs_tar.c',
|
||||
@ -27,12 +29,15 @@ files = [
|
||||
r_fs = library('r_fs', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'../../shlr/grub/include'
|
||||
])
|
||||
)
|
||||
],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [r_util, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
|
@ -10,7 +10,6 @@ files = [
|
||||
'section.c',
|
||||
'undo.c',
|
||||
'p_cache.c',
|
||||
'p/io_rbuf.c',
|
||||
'p/io_ar.c',
|
||||
'p/io_bfdbg.c',
|
||||
'p/io_bochs.c',
|
||||
@ -32,6 +31,7 @@ files = [
|
||||
'p/io_r2pipe.c',
|
||||
'p/io_r2web.c',
|
||||
'p/io_rap.c',
|
||||
'p/io_rbuf.c',
|
||||
'p/io_self.c',
|
||||
'p/io_shm.c',
|
||||
'p/io_sparse.c',
|
||||
@ -58,17 +58,19 @@ endif
|
||||
r_io = library('r_io', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'../../shlr/bochs/include',
|
||||
'../../shlr/gdb/include',
|
||||
'../../shlr/qnx/include',
|
||||
'../../shlr/windbg',
|
||||
'../../shlr/ar',
|
||||
'../../shlr/zip/include'
|
||||
])
|
||||
)
|
||||
],
|
||||
link_with: [
|
||||
r_util, r_socket, libr_shlr
|
||||
r_util,
|
||||
r_socket,
|
||||
libr_shlr
|
||||
],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
install: true,
|
||||
@ -83,7 +85,8 @@ pkgconfig_mod.generate(
|
||||
name: 'r_io',
|
||||
filebase: 'r_io',
|
||||
requires: [
|
||||
'r_util', 'r_socket'
|
||||
'r_util',
|
||||
'r_socket'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
files = [
|
||||
'lang.c',
|
||||
'p/c.c',
|
||||
# 'p/cpipe.c',
|
||||
#'p/cpipe.c',
|
||||
'p/lib.c',
|
||||
'p/pipe.c',
|
||||
'p/rust.c',
|
||||
@ -11,7 +11,10 @@ files = [
|
||||
r_lang = library('r_lang', files,
|
||||
include_directories: [platform_inc],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [r_util, r_cons],
|
||||
link_with: [
|
||||
r_util,
|
||||
r_cons
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
@ -24,7 +27,8 @@ pkgconfig_mod.generate(
|
||||
name: 'r_lang',
|
||||
filebase: 'r_lang',
|
||||
requires: [
|
||||
'r_util', 'r_cons'
|
||||
'r_util',
|
||||
'r_cons'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -73,7 +73,7 @@ static int lang_cpipe_run(RLang *lang, const char *code, int len) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static struct r_lang_plugin_t r_lang_plugin_cpipe = {
|
||||
static RLangPlugin r_lang_plugin_cpipe = {
|
||||
.name = "cpipe",
|
||||
.ext = "c2",
|
||||
.desc = "C r2pipe scripting",
|
||||
|
@ -124,7 +124,7 @@ static int lang_vala_run(RLang *lang, const char *code, int len) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static struct r_lang_plugin_t r_lang_plugin_vala = {
|
||||
static RLangPlugin r_lang_plugin_vala = {
|
||||
.name = "vala",
|
||||
.ext = "vala",
|
||||
.license = "LGPL",
|
||||
|
@ -1,19 +1,22 @@
|
||||
anal = [
|
||||
anal_plugins = [
|
||||
'6502',
|
||||
'8051',
|
||||
'arc',
|
||||
'avr',
|
||||
'arm_cs',
|
||||
'arm_gnu',
|
||||
'avr',
|
||||
'bf',
|
||||
'chip8',
|
||||
'cr16',
|
||||
'cris',
|
||||
'dalvik',
|
||||
'ebc',
|
||||
'gb',
|
||||
'h8300',
|
||||
'hexagon',
|
||||
'i4004',
|
||||
'i8080',
|
||||
'java',
|
||||
'gb',
|
||||
'm68k_cs',
|
||||
'malbolge',
|
||||
'mips_cs',
|
||||
@ -26,15 +29,18 @@ anal = [
|
||||
'ppc_gnu',
|
||||
'propeller',
|
||||
'riscv',
|
||||
'rsp',
|
||||
'sh',
|
||||
'snes',
|
||||
'sparc_cs',
|
||||
'sparc_gnu',
|
||||
'sysz',
|
||||
'tms320',
|
||||
'vax',
|
||||
#'tms320c64x',
|
||||
'v810',
|
||||
'v850',
|
||||
'vax',
|
||||
'wasm',
|
||||
'ws',
|
||||
'x86_cs',
|
||||
'xap',
|
||||
@ -43,23 +49,26 @@ anal = [
|
||||
'z80',
|
||||
]
|
||||
|
||||
asm = [
|
||||
asm_plugins = [
|
||||
'6502',
|
||||
'8051',
|
||||
'arc',
|
||||
'avr',
|
||||
'arm_as',
|
||||
'arm_cs',
|
||||
'arm_gnu',
|
||||
'arm_winedbg',
|
||||
'avr',
|
||||
'bf',
|
||||
'chip8',
|
||||
'cr16',
|
||||
'cris_gnu',
|
||||
'dalvik',
|
||||
'dcpu16',
|
||||
'gb',
|
||||
'ebc',
|
||||
'gb',
|
||||
'h8300',
|
||||
'hexagon',
|
||||
#'hexagon_gnu',
|
||||
'hppa_gnu',
|
||||
'i4004',
|
||||
'i8080',
|
||||
@ -79,6 +88,7 @@ asm = [
|
||||
'ppc_gnu',
|
||||
'propeller',
|
||||
'riscv',
|
||||
'rsp',
|
||||
'sh',
|
||||
'snes',
|
||||
'sparc_cs',
|
||||
@ -94,6 +104,7 @@ asm = [
|
||||
'ws',
|
||||
'x86_as',
|
||||
'x86_cs',
|
||||
#'x86_gas',
|
||||
'x86_nasm',
|
||||
'x86_nz',
|
||||
'xap',
|
||||
@ -102,7 +113,7 @@ asm = [
|
||||
'z80',
|
||||
]
|
||||
|
||||
bin = [
|
||||
bin_plugins = [
|
||||
'any',
|
||||
'art',
|
||||
'bf',
|
||||
@ -130,6 +141,7 @@ bin = [
|
||||
'ningb',
|
||||
'ningba',
|
||||
'nro',
|
||||
'nso',
|
||||
'omf',
|
||||
'p9',
|
||||
'pe',
|
||||
@ -144,28 +156,34 @@ bin = [
|
||||
'vsf',
|
||||
'wasm',
|
||||
'xbe',
|
||||
'zimg',
|
||||
'z64',
|
||||
'zimg',
|
||||
]
|
||||
|
||||
bin_xtr = [
|
||||
'fatmach0',
|
||||
'xtr_dyldcache'
|
||||
bin_ldr_plugins = [
|
||||
'ldr_linux',
|
||||
]
|
||||
|
||||
bp = [
|
||||
bin_xtr_plugins = [
|
||||
'xtr_dyldcache',
|
||||
'xtr_fatmach0',
|
||||
]
|
||||
|
||||
bp_plugins = [
|
||||
'arm',
|
||||
'bf',
|
||||
'mips',
|
||||
'ppc',
|
||||
'sh',
|
||||
'x86'
|
||||
]
|
||||
|
||||
core = [
|
||||
'anal'
|
||||
core_plugins = [
|
||||
'anal',
|
||||
'java'
|
||||
]
|
||||
|
||||
crypto = [
|
||||
crypto_plugins = [
|
||||
'aes',
|
||||
'aes_cbc',
|
||||
'base64',
|
||||
@ -180,50 +198,60 @@ crypto = [
|
||||
'rol',
|
||||
'ror',
|
||||
'rot',
|
||||
'serpent',
|
||||
'xor',
|
||||
'serpent'
|
||||
]
|
||||
|
||||
debug = [
|
||||
debug_plugins = [
|
||||
'bf',
|
||||
'bochs',
|
||||
'esil',
|
||||
'gdb',
|
||||
'io',
|
||||
'native',
|
||||
'null',
|
||||
'qnx',
|
||||
'rap',
|
||||
'gdb',
|
||||
'windbg'
|
||||
]
|
||||
|
||||
egg = [
|
||||
egg_plugins = [
|
||||
'exec',
|
||||
#'shya',
|
||||
'xor'
|
||||
]
|
||||
|
||||
fs = [
|
||||
fs_plugins = [
|
||||
'cpio',
|
||||
'ext2',
|
||||
'fat',
|
||||
'fb',
|
||||
'hfs',
|
||||
'hfsplus',
|
||||
'io',
|
||||
'iso9660',
|
||||
'jfs',
|
||||
'minix',
|
||||
'ntfs',
|
||||
'posix',
|
||||
'r2',
|
||||
'reiserfs',
|
||||
'sfs',
|
||||
'tar',
|
||||
'udf',
|
||||
'ufs',
|
||||
'ufs2',
|
||||
'xfs'
|
||||
]
|
||||
|
||||
io = [
|
||||
io_plugins = [
|
||||
'ar',
|
||||
'bfdbg',
|
||||
'bochs',
|
||||
'debug',
|
||||
'default',
|
||||
'gdb',
|
||||
'gprobe',
|
||||
'gzip',
|
||||
'http',
|
||||
'ihex',
|
||||
@ -233,41 +261,52 @@ io = [
|
||||
'null',
|
||||
'procpid',
|
||||
'ptrace',
|
||||
'qnx',
|
||||
'r2k',
|
||||
'r2pipe',
|
||||
'r2web',
|
||||
'rap',
|
||||
'rbuf',
|
||||
'self',
|
||||
'shm',
|
||||
'sparse',
|
||||
'tcp',
|
||||
'w32',
|
||||
'w32dbg',
|
||||
'windbg',
|
||||
'winedbg'
|
||||
'winedbg',
|
||||
'zip'
|
||||
]
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
io += [
|
||||
io_plugins += [
|
||||
'w32dbg',
|
||||
'w32',
|
||||
]
|
||||
endif
|
||||
|
||||
lang = [
|
||||
lang_plugins = [
|
||||
'c',
|
||||
'cpipe',
|
||||
'lib',
|
||||
'pipe',
|
||||
'rust',
|
||||
'vala'
|
||||
]
|
||||
|
||||
parse = [
|
||||
parse_plugins = [
|
||||
'6502_pseudo',
|
||||
'arm_pseudo',
|
||||
'att2intel',
|
||||
'avr_pseudo',
|
||||
'dalvik_pseudo',
|
||||
'm68k_pseudo',
|
||||
'mips_pseudo',
|
||||
'mreplace',
|
||||
'ppc_pseudo',
|
||||
'sh_pseudo',
|
||||
'avr_pseudo',
|
||||
'x86_pseudo',
|
||||
'z80_pseudo'
|
||||
]
|
||||
|
||||
include_files = run_command(glob_cmd + ['include/*.h']).stdout().strip().split(';')
|
||||
|
@ -4,15 +4,15 @@ files = [
|
||||
'p/parse_6502_pseudo.c',
|
||||
'p/parse_arm_pseudo.c',
|
||||
'p/parse_att2intel.c',
|
||||
'p/parse_avr_pseudo.c',
|
||||
'p/parse_dalvik_pseudo.c',
|
||||
'p/parse_m68k_pseudo.c',
|
||||
'p/parse_mips_pseudo.c',
|
||||
'p/parse_mreplace.c',
|
||||
'p/parse_ppc_pseudo.c',
|
||||
'p/parse_sh_pseudo.c',
|
||||
'p/parse_x86_pseudo.c',
|
||||
'p/parse_z80_pseudo.c',
|
||||
'p/parse_sh_pseudo.c',
|
||||
'p/parse_avr_pseudo.c',
|
||||
'p/parse_mreplace/mreplace.c',
|
||||
'p/parse_mreplace/mmemory.c'
|
||||
]
|
||||
@ -20,12 +20,18 @@ files = [
|
||||
r_parse = library('r_parse', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'../../shlr/tcc',
|
||||
])
|
||||
)
|
||||
],
|
||||
c_args: ['-DCORELIB=1'],
|
||||
link_with: [r_util, r_flag, r_syscall, r_reg, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
r_flag,
|
||||
r_syscall,
|
||||
r_reg,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
@ -38,7 +44,10 @@ pkgconfig_mod.generate(
|
||||
name: 'r_parse',
|
||||
filebase: 'r_parse',
|
||||
requires: [
|
||||
'r_util', 'r_flag', 'r_syscall', 'r_reg'
|
||||
'r_util',
|
||||
'r_flag',
|
||||
'r_syscall',
|
||||
'r_reg'
|
||||
],
|
||||
description: 'radare foundation libraries'
|
||||
)
|
||||
|
@ -5,7 +5,10 @@ files = [
|
||||
|
||||
r_syscall = library('r_syscall', files,
|
||||
include_directories: [platform_inc],
|
||||
link_with: [r_util, libr_shlr],
|
||||
link_with: [
|
||||
r_util,
|
||||
libr_shlr
|
||||
],
|
||||
install: true,
|
||||
implicit_include_directories: false,
|
||||
soversion: r2_libversion
|
||||
|
@ -84,9 +84,9 @@ files = [
|
||||
r_util = library('r_util', files,
|
||||
include_directories: [
|
||||
platform_inc,
|
||||
include_directories([
|
||||
include_directories(
|
||||
'../../shlr/zip/include'
|
||||
])
|
||||
)
|
||||
],
|
||||
dependencies: [ldl, mth, pth, utl],
|
||||
link_with: [libr_shlr],
|
||||
|
79
meson.build
79
meson.build
@ -104,7 +104,11 @@ if host_machine.system() == 'windows'
|
||||
r2_incdir = 'include'
|
||||
r2_datdir = 'share'
|
||||
|
||||
opts1 = ['r2_libdir', 'r2_incdir', 'r2_datdir']
|
||||
opts1 = [
|
||||
'r2_libdir',
|
||||
'r2_incdir',
|
||||
'r2_datdir'
|
||||
]
|
||||
foreach opt : opts1
|
||||
val = get_option(opt)
|
||||
if val != ''
|
||||
@ -119,7 +123,14 @@ if host_machine.system() == 'windows'
|
||||
r2_fortunes = join_paths(r2_datdir, 'doc')
|
||||
r2_hud = join_paths(r2_datdir, 'hud')
|
||||
|
||||
opts2 = ['r2_wwwroot', 'r2_sdb', 'r2_zigns', 'r2_themes', 'r2_fortunes', 'r2_hud']
|
||||
opts2 = [
|
||||
'r2_wwwroot',
|
||||
'r2_sdb',
|
||||
'r2_zigns',
|
||||
'r2_themes',
|
||||
'r2_fortunes',
|
||||
'r2_hud'
|
||||
]
|
||||
foreach opt : opts2
|
||||
val = get_option(opt)
|
||||
if val != ''
|
||||
@ -127,7 +138,11 @@ if host_machine.system() == 'windows'
|
||||
endif
|
||||
endforeach
|
||||
|
||||
opts3 = ['r2_plugins', 'r2_extras', 'r2_bindings']
|
||||
opts3 = [
|
||||
'r2_plugins',
|
||||
'r2_extras',
|
||||
'r2_bindings'
|
||||
]
|
||||
r2_plugins = join_paths(r2_libdir, 'plugins')
|
||||
r2_extras = join_paths(r2_libdir, 'extras')
|
||||
r2_bindings = join_paths(r2_libdir, 'bindings')
|
||||
@ -157,18 +172,20 @@ endif
|
||||
subdir('libr')
|
||||
|
||||
conf_data = configuration_data()
|
||||
conf_data.set('plugins_core', '&r_core_plugin_' + ',&r_core_plugin_'.join(core) + ', 0')
|
||||
conf_data.set('plugins_anal', '&r_anal_plugin_' + ',&r_anal_plugin_'.join(anal) + ', 0')
|
||||
conf_data.set('plugins_asm', '&r_asm_plugin_' + ',&r_asm_plugin_'.join(asm) + ', 0')
|
||||
conf_data.set('plugins_bp', '&r_bp_plugin_' + ',&r_bp_plugin_'.join(bp) + ', 0')
|
||||
conf_data.set('plugins_bin', '&r_bin_plugin_' + ',&r_bin_plugin_'.join(bin) + ', 0')
|
||||
conf_data.set('plugins_crypto', '&r_crypto_plugin_' + ',&r_crypto_plugin_'.join(crypto) + ', 0')
|
||||
conf_data.set('plugins_io', '&r_io_plugin_' + ',&r_io_plugin_'.join(io) + ', 0')
|
||||
conf_data.set('plugins_fs', '&r_fs_plugin_' + ',&r_fs_plugin_'.join(fs) + ', 0')
|
||||
conf_data.set('plugins_debug', '&r_debug_plugin_' + ',&r_debug_plugin_'.join(debug) + ', 0')
|
||||
conf_data.set('plugins_egg', '&r_egg_plugin_' + ',&r_egg_plugin_'.join(egg) + ', 0')
|
||||
conf_data.set('plugins_lang', '&r_lang_plugin_' + ',&r_lang_plugin_'.join(lang) + ', 0')
|
||||
conf_data.set('plugins_parse', '&r_parse_plugin_' + ',&r_parse_plugin_'.join(parse) + ', 0')
|
||||
conf_data.set('plugins_core', '&r_core_plugin_' + ', &r_core_plugin_'.join(core_plugins) + ', 0')
|
||||
conf_data.set('plugins_anal', '&r_anal_plugin_' + ', &r_anal_plugin_'.join(anal_plugins) + ', 0')
|
||||
conf_data.set('plugins_asm', '&r_asm_plugin_' + ', &r_asm_plugin_'.join(asm_plugins) + ', 0')
|
||||
conf_data.set('plugins_bp', '&r_bp_plugin_' + ', &r_bp_plugin_'.join(bp_plugins) + ', 0')
|
||||
conf_data.set('plugins_bin', '&r_bin_plugin_' + ', &r_bin_plugin_'.join(bin_plugins) + ', 0')
|
||||
conf_data.set('plugins_bin_ldr', '&r_bin_ldr_plugin_' + ', &r_bin_ldr_plugin_'.join(bin_ldr_plugins) + ', 0')
|
||||
conf_data.set('plugins_bin_xtr', '&r_bin_xtr_plugin_' + ', &r_bin_xtr_plugin_'.join(bin_xtr_plugins) + ', 0')
|
||||
conf_data.set('plugins_crypto', '&r_crypto_plugin_' + ', &r_crypto_plugin_'.join(crypto_plugins) + ', 0')
|
||||
conf_data.set('plugins_io', '&r_io_plugin_' + ', &r_io_plugin_'.join(io_plugins) + ', 0')
|
||||
conf_data.set('plugins_fs', '&r_fs_plugin_' + ', &r_fs_plugin_'.join(fs_plugins) + ', 0')
|
||||
conf_data.set('plugins_debug', '&r_debug_plugin_' + ', &r_debug_plugin_'.join(debug_plugins) + ', 0')
|
||||
conf_data.set('plugins_egg', '&r_egg_plugin_' + ', &r_egg_plugin_'.join(egg_plugins) + ', 0')
|
||||
conf_data.set('plugins_lang', '&r_lang_plugin_' + ', &r_lang_plugin_'.join(lang_plugins) + ', 0')
|
||||
conf_data.set('plugins_parse', '&r_parse_plugin_' + ', &r_parse_plugin_'.join(parse_plugins) + ', 0')
|
||||
config_h = configure_file(
|
||||
input: 'libr/config.h.in',
|
||||
output: 'config.h',
|
||||
@ -285,15 +302,31 @@ if not meson.is_subproject()
|
||||
subdir('binr/rafind2')
|
||||
subdir('binr/rax2')
|
||||
else
|
||||
libr2_lib = [
|
||||
r_anal, r_asm, r_bin, r_bp, r_config, r_cons, r_core, r_crypto, r_egg,
|
||||
r_flag, r_fs, r_hash, r_io, r_lang, r_magic, r_parse, r_reg, r_search,
|
||||
r_socket, r_syscall, r_util
|
||||
]
|
||||
libr2_inc = include_directories(['.', 'libr/include'])
|
||||
libr2_dep = declare_dependency(
|
||||
link_with: libr2_lib,
|
||||
include_directories: libr2_inc,
|
||||
link_with: [
|
||||
r_anal,
|
||||
r_asm,
|
||||
r_bin,
|
||||
r_bp,
|
||||
r_config,
|
||||
r_cons,
|
||||
r_core,
|
||||
r_crypto,
|
||||
r_egg,
|
||||
r_flag,
|
||||
r_fs,
|
||||
r_hash,
|
||||
r_io,
|
||||
r_lang,
|
||||
r_magic,
|
||||
r_parse,
|
||||
r_reg,
|
||||
r_search,
|
||||
r_socket,
|
||||
r_syscall,
|
||||
r_util
|
||||
],
|
||||
include_directories: include_directories('.', 'libr/include'),
|
||||
version: r2_version
|
||||
)
|
||||
endif
|
||||
|
@ -6,11 +6,11 @@
|
||||
#include <r_util.h>
|
||||
#include <stdint.h>
|
||||
|
||||
R_API char * dso_json_dict_entry_to_str (DsoJsonDictEntry * entry);
|
||||
R_API char * dso_json_list_to_str (DsoJsonList *list);
|
||||
R_API char * dso_json_dict_to_str (DsoJsonDict *list);
|
||||
R_API char * dso_json_num_to_str (DsoJsonNum * num);
|
||||
R_API char * dso_json_str_to_str (DsoJsonStr *str);
|
||||
char * dso_json_dict_entry_to_str (DsoJsonDictEntry * entry);
|
||||
char * dso_json_list_to_str (DsoJsonList *list);
|
||||
char * dso_json_dict_to_str (DsoJsonDict *list);
|
||||
char * dso_json_num_to_str (DsoJsonNum * num);
|
||||
char * dso_json_str_to_str (DsoJsonStr *str);
|
||||
|
||||
static int cmpDsoStr_to_str (DsoJsonStr *dsoStr1, char *dsoStr2);
|
||||
static const DsoJsonInfo* get_type_info (unsigned int type);
|
||||
@ -85,7 +85,7 @@ static int dso_json_is_dict_entry (DsoJsonObj *y) {
|
||||
return get_type (y) == DSO_JSON_DICT_ENTRY;
|
||||
}
|
||||
|
||||
R_API ut8 dso_json_char_needs_hexing ( ut8 b) {
|
||||
ut8 dso_json_char_needs_hexing ( ut8 b) {
|
||||
if (b < 0x20) {
|
||||
return 1;
|
||||
}
|
||||
@ -102,7 +102,7 @@ R_API ut8 dso_json_char_needs_hexing ( ut8 b) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
R_API char * dso_json_obj_to_str (DsoJsonObj * dso_obj) {
|
||||
char * dso_json_obj_to_str (DsoJsonObj * dso_obj) {
|
||||
if (dso_obj && dso_obj->info) {
|
||||
switch (dso_obj->info->type) {
|
||||
case DSO_JSON_NULL: return strdup ("null");
|
||||
@ -116,7 +116,7 @@ R_API char * dso_json_obj_to_str (DsoJsonObj * dso_obj) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
R_API void dso_json_obj_del (DsoJsonObj *dso_obj) {
|
||||
void dso_json_obj_del (DsoJsonObj *dso_obj) {
|
||||
if (!dso_obj) return;
|
||||
switch (dso_obj->info->type) {
|
||||
case DSO_JSON_NULL: /*do nothing */ break;
|
||||
@ -184,18 +184,18 @@ static DsoJsonStr * dso_json_get_str (DsoJsonObj *dso_obj) {
|
||||
return str;
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_null_new () {
|
||||
DsoJsonObj * dso_json_null_new () {
|
||||
DsoJsonObj *x = json_new0 (sizeof (DsoJsonObj));
|
||||
if (!x) return NULL;
|
||||
x->info = get_type_info (DSO_JSON_NULL);
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API void dso_json_null_free (void *x) {
|
||||
void dso_json_null_free (void *x) {
|
||||
free (x);
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_str_new () {
|
||||
DsoJsonObj * dso_json_str_new () {
|
||||
DsoJsonObj *x = dso_json_null_new ();
|
||||
if (!x) return NULL;
|
||||
x->info = get_type_info (DSO_JSON_STR);
|
||||
@ -203,7 +203,7 @@ R_API DsoJsonObj * dso_json_str_new () {
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API void dso_json_str_free (void *y) {
|
||||
void dso_json_str_free (void *y) {
|
||||
DsoJsonStr *x = (DsoJsonStr *)y;
|
||||
if (x) {
|
||||
free (x->data);
|
||||
@ -212,7 +212,7 @@ R_API void dso_json_str_free (void *y) {
|
||||
}
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_dict_entry_new () {
|
||||
DsoJsonObj * dso_json_dict_entry_new () {
|
||||
DsoJsonObj *x = dso_json_null_new ();
|
||||
if (!x) return NULL;
|
||||
x->info = get_type_info (DSO_JSON_DICT_ENTRY);
|
||||
@ -226,7 +226,7 @@ R_API DsoJsonObj * dso_json_dict_entry_new () {
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_dict_entry_new_from_key_obj_val_obj (DsoJsonObj *key, DsoJsonObj *value) {
|
||||
DsoJsonObj * dso_json_dict_entry_new_from_key_obj_val_obj (DsoJsonObj *key, DsoJsonObj *value) {
|
||||
DsoJsonObj *x = dso_json_dict_entry_new ();
|
||||
if (!x) return NULL;
|
||||
dso_json_obj_del (x->val._dict_entry->key);
|
||||
@ -236,7 +236,7 @@ R_API DsoJsonObj * dso_json_dict_entry_new_from_key_obj_val_obj (DsoJsonObj *key
|
||||
return x;
|
||||
|
||||
}
|
||||
R_API void dso_json_dict_entry_free (void *y) {
|
||||
void dso_json_dict_entry_free (void *y) {
|
||||
DsoJsonDictEntry *entry = (DsoJsonDictEntry *)y;
|
||||
if (entry) {
|
||||
dso_json_obj_del (entry->key);
|
||||
@ -247,7 +247,7 @@ R_API void dso_json_dict_entry_free (void *y) {
|
||||
free (entry);
|
||||
}
|
||||
|
||||
R_API char * dso_json_dict_entry_to_str (DsoJsonDictEntry * entry) {
|
||||
char * dso_json_dict_entry_to_str (DsoJsonDictEntry * entry) {
|
||||
char *res = NULL;
|
||||
if (entry) {
|
||||
char *key = dso_json_obj_to_str (entry->key);
|
||||
@ -270,7 +270,7 @@ R_API char * dso_json_dict_entry_to_str (DsoJsonDictEntry * entry) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_set_key_str (DsoJsonObj * entry_obj, char *key) {
|
||||
int dso_json_dict_entry_set_key_str (DsoJsonObj * entry_obj, char *key) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonDictEntry *entry = (DsoJsonDictEntry *)entry_obj;
|
||||
@ -284,7 +284,7 @@ R_API int dso_json_dict_entry_set_key_str (DsoJsonObj * entry_obj, char *key) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_set_key_str_len (DsoJsonObj * entry_obj, char *key, unsigned int len) {
|
||||
int dso_json_dict_entry_set_key_str_len (DsoJsonObj * entry_obj, char *key, unsigned int len) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonDictEntry *entry = (DsoJsonDictEntry *)entry_obj;
|
||||
@ -298,7 +298,7 @@ R_API int dso_json_dict_entry_set_key_str_len (DsoJsonObj * entry_obj, char *key
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_set_key_num (DsoJsonObj * entry_obj, st64 num) {
|
||||
int dso_json_dict_entry_set_key_num (DsoJsonObj * entry_obj, st64 num) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonDictEntry *entry = (DsoJsonDictEntry *)entry_obj;
|
||||
@ -312,7 +312,7 @@ R_API int dso_json_dict_entry_set_key_num (DsoJsonObj * entry_obj, st64 num) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_append_str (DsoJsonObj *entry_obj, char *str) {
|
||||
int dso_json_dict_entry_value_append_str (DsoJsonObj *entry_obj, char *str) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_str = dso_json_str_new_from_str (str);
|
||||
@ -322,7 +322,7 @@ R_API int dso_json_dict_entry_value_append_str (DsoJsonObj *entry_obj, char *str
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_append_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len) {
|
||||
int dso_json_dict_entry_value_append_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_str = dso_json_str_new_from_str_len (str, len);
|
||||
@ -332,7 +332,7 @@ R_API int dso_json_dict_entry_value_append_str_len (DsoJsonObj *entry_obj, char
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_append_num (DsoJsonObj *entry_obj, st64 num) {
|
||||
int dso_json_dict_entry_value_append_num (DsoJsonObj *entry_obj, st64 num) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_num = dso_json_num_new_from_num (num);
|
||||
@ -342,7 +342,7 @@ R_API int dso_json_dict_entry_value_append_num (DsoJsonObj *entry_obj, st64 num)
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_append_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj) {
|
||||
int dso_json_dict_entry_value_append_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj) {
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonDictEntry *x = entry_obj->val._dict_entry;
|
||||
|
||||
@ -365,7 +365,7 @@ R_API int dso_json_dict_entry_value_append_obj (DsoJsonObj *entry_obj, DsoJsonOb
|
||||
return false;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_set_str (DsoJsonObj *entry_obj, char *str) {
|
||||
int dso_json_dict_entry_value_set_str (DsoJsonObj *entry_obj, char *str) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_val = dso_json_str_new_from_str (str);
|
||||
@ -374,7 +374,7 @@ R_API int dso_json_dict_entry_value_set_str (DsoJsonObj *entry_obj, char *str) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_set_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len) {
|
||||
int dso_json_dict_entry_value_set_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_val = dso_json_str_new_from_str_len (str, len);
|
||||
@ -383,7 +383,7 @@ R_API int dso_json_dict_entry_value_set_str_len (DsoJsonObj *entry_obj, char *st
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_set_num (DsoJsonObj *entry_obj, st64 num) {
|
||||
int dso_json_dict_entry_value_set_num (DsoJsonObj *entry_obj, st64 num) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_val = dso_json_num_new_from_num (num);
|
||||
@ -392,7 +392,7 @@ R_API int dso_json_dict_entry_value_set_num (DsoJsonObj *entry_obj, st64 num) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_set_empty_dict (DsoJsonObj *entry_obj) {
|
||||
int dso_json_dict_entry_value_set_empty_dict (DsoJsonObj *entry_obj) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_val = dso_json_dict_new ();
|
||||
@ -401,7 +401,7 @@ R_API int dso_json_dict_entry_value_set_empty_dict (DsoJsonObj *entry_obj) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_set_empty_list (DsoJsonObj *entry_obj) {
|
||||
int dso_json_dict_entry_value_set_empty_list (DsoJsonObj *entry_obj) {
|
||||
int res = false;
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonObj *o_val = dso_json_list_new ();
|
||||
@ -410,7 +410,7 @@ R_API int dso_json_dict_entry_value_set_empty_list (DsoJsonObj *entry_obj) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_entry_value_set_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj) {
|
||||
int dso_json_dict_entry_value_set_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj) {
|
||||
if (dso_json_is_dict_entry (entry_obj)) {
|
||||
DsoJsonDictEntry *entry = entry_obj->val._dict_entry;
|
||||
if (entry->value) dso_json_obj_del (entry->value);
|
||||
@ -420,7 +420,7 @@ R_API int dso_json_dict_entry_value_set_obj (DsoJsonObj *entry_obj, DsoJsonObj *
|
||||
return false;
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_list_new () {
|
||||
DsoJsonObj * dso_json_list_new () {
|
||||
DsoJsonObj *x = dso_json_null_new ();
|
||||
if (x) {
|
||||
x->info = get_type_info (DSO_JSON_LIST);
|
||||
@ -434,7 +434,7 @@ R_API DsoJsonObj * dso_json_list_new () {
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API void dso_json_list_free (DsoJsonObj *x) {
|
||||
void dso_json_list_free (DsoJsonObj *x) {
|
||||
if (!x) return;
|
||||
if (x->val._list && x->val._list->json_list) {
|
||||
r_list_free (x->val._list->json_list);
|
||||
@ -442,14 +442,14 @@ R_API void dso_json_list_free (DsoJsonObj *x) {
|
||||
}
|
||||
}
|
||||
|
||||
R_API char * dso_json_list_to_str (DsoJsonList *list) {
|
||||
char * dso_json_list_to_str (DsoJsonList *list) {
|
||||
if (list && list->json_list) {
|
||||
return build_str_from_str_list_for_iterable (list->json_list, 1);
|
||||
}
|
||||
return strdup ("[]");
|
||||
}
|
||||
|
||||
R_API int dso_json_list_append (DsoJsonObj *list_obj, DsoJsonObj *y) {
|
||||
int dso_json_list_append (DsoJsonObj *list_obj, DsoJsonObj *y) {
|
||||
if (get_type (list_obj) == DSO_JSON_LIST) {
|
||||
DsoJsonList * list = list_obj->val._list;
|
||||
r_list_append (list->json_list, y);
|
||||
@ -458,7 +458,7 @@ R_API int dso_json_list_append (DsoJsonObj *list_obj, DsoJsonObj *y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
R_API int dso_json_list_append_str (DsoJsonObj *list_obj, char *y) {
|
||||
int dso_json_list_append_str (DsoJsonObj *list_obj, char *y) {
|
||||
if (get_type (list_obj) == DSO_JSON_LIST) {
|
||||
DsoJsonObj *val = dso_json_str_new_from_str (y);
|
||||
int res = dso_json_list_append (list_obj, val);
|
||||
@ -468,7 +468,7 @@ R_API int dso_json_list_append_str (DsoJsonObj *list_obj, char *y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
R_API int dso_json_list_append_num (DsoJsonObj *list_obj, ut64 y) {
|
||||
int dso_json_list_append_num (DsoJsonObj *list_obj, ut64 y) {
|
||||
if (get_type (list_obj) == DSO_JSON_LIST) {
|
||||
DsoJsonObj *val = dso_json_num_new_from_num (y);
|
||||
int res = dso_json_list_append (list_obj, val);
|
||||
@ -478,7 +478,7 @@ R_API int dso_json_list_append_num (DsoJsonObj *list_obj, ut64 y) {
|
||||
return false;
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_dict_new () {
|
||||
DsoJsonObj * dso_json_dict_new () {
|
||||
DsoJsonObj *x = dso_json_null_new ();
|
||||
if (x) {
|
||||
x->info = get_type_info (DSO_JSON_DICT);
|
||||
@ -492,7 +492,7 @@ R_API DsoJsonObj * dso_json_dict_new () {
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API void dso_json_dict_free (void *y) {
|
||||
void dso_json_dict_free (void *y) {
|
||||
DsoJsonDict *x = (DsoJsonDict *)y;
|
||||
if (x && x->json_dict) {
|
||||
r_list_free (x->json_dict);
|
||||
@ -501,14 +501,14 @@ R_API void dso_json_dict_free (void *y) {
|
||||
free (x);
|
||||
}
|
||||
|
||||
R_API char * dso_json_dict_to_str (DsoJsonDict *dict) {
|
||||
char * dso_json_dict_to_str (DsoJsonDict *dict) {
|
||||
if (dict && dict->json_dict) {
|
||||
return build_str_from_str_list_for_iterable (dict->json_dict, 0);
|
||||
}
|
||||
return strdup ("{}");
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_insert_str_key_obj (DsoJsonObj *dict, char *key, DsoJsonObj *val_obj) {
|
||||
int dso_json_dict_insert_str_key_obj (DsoJsonObj *dict, char *key, DsoJsonObj *val_obj) {
|
||||
DsoJsonObj *key_obj = dso_json_str_new_from_str (key);
|
||||
int res = dso_json_dict_insert_key_obj (dict, key_obj, val_obj);
|
||||
if (!res) {
|
||||
@ -517,7 +517,7 @@ R_API int dso_json_dict_insert_str_key_obj (DsoJsonObj *dict, char *key, DsoJson
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_insert_str_key_num (DsoJsonObj *dict, char *key, int val) {
|
||||
int dso_json_dict_insert_str_key_num (DsoJsonObj *dict, char *key, int val) {
|
||||
DsoJsonObj *key_obj = dso_json_str_new_from_str (key);
|
||||
DsoJsonObj *val_obj = dso_json_num_new_from_num (val);
|
||||
int res = dso_json_dict_insert_key_obj (dict, key_obj, val_obj);
|
||||
@ -527,7 +527,7 @@ R_API int dso_json_dict_insert_str_key_num (DsoJsonObj *dict, char *key, int val
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_insert_str_key_str (DsoJsonObj *dict, char *key, char *val) {
|
||||
int dso_json_dict_insert_str_key_str (DsoJsonObj *dict, char *key, char *val) {
|
||||
DsoJsonObj *key_obj = dso_json_str_new_from_str (key),
|
||||
*val_obj = dso_json_str_new_from_str (val);
|
||||
int res = dso_json_dict_insert_key_obj (dict, key_obj, val_obj);
|
||||
@ -538,7 +538,7 @@ R_API int dso_json_dict_insert_str_key_str (DsoJsonObj *dict, char *key, char *v
|
||||
}
|
||||
|
||||
// create keys from num value
|
||||
R_API int dso_json_dict_insert_num_key_obj (DsoJsonObj *dict, int key, DsoJsonObj *val_obj) {
|
||||
int dso_json_dict_insert_num_key_obj (DsoJsonObj *dict, int key, DsoJsonObj *val_obj) {
|
||||
DsoJsonObj *key_obj = dso_json_str_new_from_num (key);
|
||||
int res = dso_json_dict_insert_key_obj (dict, key_obj, val_obj);
|
||||
if (!res) {
|
||||
@ -548,7 +548,7 @@ R_API int dso_json_dict_insert_num_key_obj (DsoJsonObj *dict, int key, DsoJsonOb
|
||||
}
|
||||
|
||||
|
||||
R_API int dso_json_dict_insert_num_key_num (DsoJsonObj *dict, int key, int val) {
|
||||
int dso_json_dict_insert_num_key_num (DsoJsonObj *dict, int key, int val) {
|
||||
DsoJsonObj *key_obj = dso_json_str_new_from_num (key),
|
||||
*val_obj = dso_json_num_new_from_num (val);
|
||||
int res = dso_json_dict_insert_key_obj (dict, key_obj, val_obj);
|
||||
@ -558,7 +558,7 @@ R_API int dso_json_dict_insert_num_key_num (DsoJsonObj *dict, int key, int val)
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_insert_num_key_str (DsoJsonObj *dict, int key, char *val) {
|
||||
int dso_json_dict_insert_num_key_str (DsoJsonObj *dict, int key, char *val) {
|
||||
DsoJsonObj *key_obj = dso_json_str_new_from_num (key),
|
||||
*val_obj = dso_json_str_new_from_str (val);
|
||||
int res = dso_json_dict_insert_key_obj (dict, key_obj, val_obj);
|
||||
@ -569,7 +569,7 @@ R_API int dso_json_dict_insert_num_key_str (DsoJsonObj *dict, int key, char *val
|
||||
}
|
||||
|
||||
// TODO inserting the dicts.
|
||||
R_API int dso_json_dict_insert_key_obj (DsoJsonObj *dict, DsoJsonObj *key, DsoJsonObj *value) {
|
||||
int dso_json_dict_insert_key_obj (DsoJsonObj *dict, DsoJsonObj *key, DsoJsonObj *value) {
|
||||
int res = false;
|
||||
RList* the_list = dso_json_get_list (dict);
|
||||
if (!the_list) return false;
|
||||
@ -591,11 +591,11 @@ R_API int dso_json_dict_insert_key_obj (DsoJsonObj *dict, DsoJsonObj *key, DsoJs
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_remove_key_obj (DsoJsonObj *dict, DsoJsonObj *key) {
|
||||
int dso_json_dict_remove_key_obj (DsoJsonObj *dict, DsoJsonObj *key) {
|
||||
return dso_json_dict_remove_key_str (dict, dso_json_get_str_data (key));
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_remove_key_str (DsoJsonObj *dict, char *key) {
|
||||
int dso_json_dict_remove_key_str (DsoJsonObj *dict, char *key) {
|
||||
RListIter *iter;
|
||||
DsoJsonObj *dso_obj;
|
||||
int res = false;
|
||||
@ -615,11 +615,11 @@ R_API int dso_json_dict_remove_key_str (DsoJsonObj *dict, char *key) {
|
||||
return res;
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_contains_key_obj (DsoJsonObj *dict, DsoJsonObj *key) {
|
||||
int dso_json_dict_contains_key_obj (DsoJsonObj *dict, DsoJsonObj *key) {
|
||||
return dso_json_dict_contains_key_str (dict, dso_json_get_str_data (key));
|
||||
}
|
||||
|
||||
R_API int dso_json_dict_contains_key_str (DsoJsonObj *dict, char *key) {
|
||||
int dso_json_dict_contains_key_str (DsoJsonObj *dict, char *key) {
|
||||
RListIter *iter;
|
||||
DsoJsonObj *dso_obj;
|
||||
RList* the_list = dso_json_get_list (dict);
|
||||
@ -638,7 +638,7 @@ R_API int dso_json_dict_contains_key_str (DsoJsonObj *dict, char *key) {
|
||||
|
||||
// TODO append value to key 1) check that key is valid, 2) if not create new entry and append it
|
||||
|
||||
R_API DsoJsonObj * dso_json_num_new () {
|
||||
DsoJsonObj * dso_json_num_new () {
|
||||
DsoJsonObj *x = dso_json_null_new ();
|
||||
if (!x) return NULL;
|
||||
x->info = get_type_info (DSO_JSON_NUM);
|
||||
@ -646,22 +646,22 @@ R_API DsoJsonObj * dso_json_num_new () {
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API void dso_json_num_free (void *y) {
|
||||
void dso_json_num_free (void *y) {
|
||||
DsoJsonNum *x = (DsoJsonNum *)y;
|
||||
free (x);
|
||||
}
|
||||
|
||||
R_API char * dso_json_num_to_str (DsoJsonNum * num) {
|
||||
char * dso_json_num_to_str (DsoJsonNum * num) {
|
||||
return r_str_newf ("%"PFMT64d, num->value);
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_num_new_from_num (ut64 num) {
|
||||
DsoJsonObj * dso_json_num_new_from_num (ut64 num) {
|
||||
DsoJsonObj *x = dso_json_num_new ();
|
||||
if (x) x->val._num->value = num;
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API char * dso_json_convert_string (const char * bytes, ut32 len) {
|
||||
char * dso_json_convert_string (const char * bytes, ut32 len) {
|
||||
ut32 idx = 0, pos = 1;
|
||||
ut32 str_sz = 4*len+1+2;
|
||||
char *cpy_buffer = len > 0 ? calloc (1, str_sz): NULL;
|
||||
@ -685,14 +685,14 @@ R_API char * dso_json_convert_string (const char * bytes, ut32 len) {
|
||||
return cpy_buffer;
|
||||
}
|
||||
|
||||
R_API char * dso_json_str_to_str (DsoJsonStr *str) {
|
||||
char * dso_json_str_to_str (DsoJsonStr *str) {
|
||||
if (str && str->data && str->len> 0) {
|
||||
return dso_json_convert_string (str->data, str->len);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_str_new_from_str (const char *str) {
|
||||
DsoJsonObj * dso_json_str_new_from_str (const char *str) {
|
||||
DsoJsonObj *x = dso_json_str_new ();
|
||||
if (!x) return NULL;
|
||||
DsoJsonStr * dsoStr = x->val._str;
|
||||
@ -701,7 +701,7 @@ R_API DsoJsonObj * dso_json_str_new_from_str (const char *str) {
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_str_new_from_str_len (const char *str, unsigned int len) {
|
||||
DsoJsonObj * dso_json_str_new_from_str_len (const char *str, unsigned int len) {
|
||||
DsoJsonObj *x = dso_json_str_new ();
|
||||
if (!x) return NULL;
|
||||
DsoJsonStr * dsoStr = x->val._str;
|
||||
@ -710,7 +710,7 @@ R_API DsoJsonObj * dso_json_str_new_from_str_len (const char *str, unsigned int
|
||||
return x;
|
||||
}
|
||||
|
||||
R_API DsoJsonObj * dso_json_str_new_from_num (long num) {
|
||||
DsoJsonObj * dso_json_str_new_from_num (long num) {
|
||||
DsoJsonObj *x = dso_json_str_new ();
|
||||
if (!x) return NULL;
|
||||
DsoJsonStr * dsoStr = x->val._str;
|
||||
|
@ -57,59 +57,59 @@ typedef struct basic_json_t {
|
||||
} val;
|
||||
} DsoJsonObj;
|
||||
|
||||
R_API ut8 dso_json_char_needs_hexing ( ut8 b);
|
||||
ut8 dso_json_char_needs_hexing ( ut8 b);
|
||||
|
||||
R_API void dso_json_obj_del (DsoJsonObj *dso_obj);
|
||||
R_API char * dso_json_obj_to_str (DsoJsonObj * dso_obj);
|
||||
R_API DsoJsonObj * dso_json_null_new (void);
|
||||
R_API void dso_json_null_free (void *x);
|
||||
R_API DsoJsonObj * dso_json_str_new (void);
|
||||
R_API void dso_json_str_free (void *y);
|
||||
R_API DsoJsonObj * dso_json_str_new_from_str (const char *str);
|
||||
R_API DsoJsonObj * dso_json_str_new_from_str_len (const char *str, unsigned int len);
|
||||
R_API DsoJsonObj * dso_json_str_new_from_num (long num);
|
||||
void dso_json_obj_del (DsoJsonObj *dso_obj);
|
||||
char * dso_json_obj_to_str (DsoJsonObj * dso_obj);
|
||||
DsoJsonObj * dso_json_null_new (void);
|
||||
void dso_json_null_free (void *x);
|
||||
DsoJsonObj * dso_json_str_new (void);
|
||||
void dso_json_str_free (void *y);
|
||||
DsoJsonObj * dso_json_str_new_from_str (const char *str);
|
||||
DsoJsonObj * dso_json_str_new_from_str_len (const char *str, unsigned int len);
|
||||
DsoJsonObj * dso_json_str_new_from_num (long num);
|
||||
|
||||
R_API DsoJsonObj * dso_json_dict_entry_new (void);
|
||||
R_API void dso_json_dict_entry_free (void *y);
|
||||
R_API int dso_json_dict_entry_set_key_str (DsoJsonObj * entry_obj, char *key);
|
||||
R_API int dso_json_dict_entry_set_key_str_len (DsoJsonObj * entry_obj, char *key, unsigned int len);
|
||||
R_API int dso_json_dict_entry_set_key_num (DsoJsonObj * entry_obj, st64 num);
|
||||
R_API int dso_json_dict_entry_value_append_str (DsoJsonObj *entry_obj, char *str);
|
||||
R_API int dso_json_dict_entry_value_append_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len);
|
||||
R_API int dso_json_dict_entry_value_append_num (DsoJsonObj *entry_obj, st64 num);
|
||||
R_API int dso_json_dict_entry_value_append_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj);
|
||||
R_API int dso_json_dict_entry_value_set_str (DsoJsonObj *entry_obj, char *str);
|
||||
R_API int dso_json_dict_entry_value_set_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len);
|
||||
R_API int dso_json_dict_entry_value_set_num (DsoJsonObj *entry_obj, st64 num);
|
||||
R_API int dso_json_dict_entry_value_set_empty_dict (DsoJsonObj *entry_obj);
|
||||
R_API int dso_json_dict_entry_value_set_empty_list (DsoJsonObj *entry_obj);
|
||||
R_API int dso_json_dict_entry_value_set_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj);
|
||||
DsoJsonObj * dso_json_dict_entry_new (void);
|
||||
void dso_json_dict_entry_free (void *y);
|
||||
int dso_json_dict_entry_set_key_str (DsoJsonObj * entry_obj, char *key);
|
||||
int dso_json_dict_entry_set_key_str_len (DsoJsonObj * entry_obj, char *key, unsigned int len);
|
||||
int dso_json_dict_entry_set_key_num (DsoJsonObj * entry_obj, st64 num);
|
||||
int dso_json_dict_entry_value_append_str (DsoJsonObj *entry_obj, char *str);
|
||||
int dso_json_dict_entry_value_append_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len);
|
||||
int dso_json_dict_entry_value_append_num (DsoJsonObj *entry_obj, st64 num);
|
||||
int dso_json_dict_entry_value_append_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj);
|
||||
int dso_json_dict_entry_value_set_str (DsoJsonObj *entry_obj, char *str);
|
||||
int dso_json_dict_entry_value_set_str_len (DsoJsonObj *entry_obj, char *str, unsigned int len);
|
||||
int dso_json_dict_entry_value_set_num (DsoJsonObj *entry_obj, st64 num);
|
||||
int dso_json_dict_entry_value_set_empty_dict (DsoJsonObj *entry_obj);
|
||||
int dso_json_dict_entry_value_set_empty_list (DsoJsonObj *entry_obj);
|
||||
int dso_json_dict_entry_value_set_obj (DsoJsonObj *entry_obj, DsoJsonObj *obj);
|
||||
|
||||
R_API DsoJsonObj * dso_json_list_new (void);
|
||||
R_API void dso_json_list_free (DsoJsonObj *x);
|
||||
R_API int dso_json_list_append (DsoJsonObj *list_obj, DsoJsonObj *y);
|
||||
R_API int dso_json_list_append_str (DsoJsonObj *list_obj, char *y);
|
||||
R_API int dso_json_list_append_num (DsoJsonObj *list_obj, ut64 y);
|
||||
DsoJsonObj * dso_json_list_new (void);
|
||||
void dso_json_list_free (DsoJsonObj *x);
|
||||
int dso_json_list_append (DsoJsonObj *list_obj, DsoJsonObj *y);
|
||||
int dso_json_list_append_str (DsoJsonObj *list_obj, char *y);
|
||||
int dso_json_list_append_num (DsoJsonObj *list_obj, ut64 y);
|
||||
|
||||
R_API DsoJsonObj * dso_json_dict_new (void);
|
||||
R_API int dso_json_dict_insert_str_key_obj (DsoJsonObj *dict, char *key, DsoJsonObj *val_obj);
|
||||
R_API int dso_json_dict_insert_str_key_num (DsoJsonObj *dict, char *key, int val);
|
||||
R_API int dso_json_dict_insert_str_key_str (DsoJsonObj *dict, char *key, char *val);
|
||||
R_API int dso_json_dict_insert_num_key_obj (DsoJsonObj *dict, int key, DsoJsonObj *val_obj);
|
||||
R_API int dso_json_dict_insert_num_key_num (DsoJsonObj *dict, int key, int val);
|
||||
R_API int dso_json_dict_insert_num_key_str (DsoJsonObj *dict, int key, char *val);
|
||||
R_API int dso_json_dict_insert_key_obj (DsoJsonObj *dict, DsoJsonObj *key, DsoJsonObj *value);
|
||||
R_API int dso_json_dict_remove_key_obj (DsoJsonObj *dict, DsoJsonObj *key);
|
||||
R_API int dso_json_dict_remove_key_str (DsoJsonObj *dict, char *key);
|
||||
R_API int dso_json_dict_contains_key_str (DsoJsonObj *dict, char *key);
|
||||
R_API int dso_json_dict_contains_key_obj (DsoJsonObj *dict, DsoJsonObj *key);
|
||||
R_API void dso_json_dict_free (void * y);
|
||||
DsoJsonObj * dso_json_dict_new (void);
|
||||
int dso_json_dict_insert_str_key_obj (DsoJsonObj *dict, char *key, DsoJsonObj *val_obj);
|
||||
int dso_json_dict_insert_str_key_num (DsoJsonObj *dict, char *key, int val);
|
||||
int dso_json_dict_insert_str_key_str (DsoJsonObj *dict, char *key, char *val);
|
||||
int dso_json_dict_insert_num_key_obj (DsoJsonObj *dict, int key, DsoJsonObj *val_obj);
|
||||
int dso_json_dict_insert_num_key_num (DsoJsonObj *dict, int key, int val);
|
||||
int dso_json_dict_insert_num_key_str (DsoJsonObj *dict, int key, char *val);
|
||||
int dso_json_dict_insert_key_obj (DsoJsonObj *dict, DsoJsonObj *key, DsoJsonObj *value);
|
||||
int dso_json_dict_remove_key_obj (DsoJsonObj *dict, DsoJsonObj *key);
|
||||
int dso_json_dict_remove_key_str (DsoJsonObj *dict, char *key);
|
||||
int dso_json_dict_contains_key_str (DsoJsonObj *dict, char *key);
|
||||
int dso_json_dict_contains_key_obj (DsoJsonObj *dict, DsoJsonObj *key);
|
||||
void dso_json_dict_free (void * y);
|
||||
|
||||
R_API DsoJsonObj * dso_json_num_new (void);
|
||||
R_API void dso_json_num_free (void *y);
|
||||
R_API DsoJsonObj * dso_json_num_new_from_num (ut64 num);
|
||||
DsoJsonObj * dso_json_num_new (void);
|
||||
void dso_json_num_free (void *y);
|
||||
DsoJsonObj * dso_json_num_new_from_num (ut64 num);
|
||||
|
||||
R_API char * dso_json_convert_string (const char * bytes, ut32 len );
|
||||
char * dso_json_convert_string (const char * bytes, ut32 len );
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -359,7 +359,7 @@ grub_files = [
|
||||
#'grub/fs/befs.c',
|
||||
#'grub/fs/befs_be.c',
|
||||
'grub/fs/btrfs.c',
|
||||
#'grub/fs/cpio.c',
|
||||
'grub/fs/cpio.c',
|
||||
'grub/fs/ext2.c',
|
||||
'grub/fs/fat.c',
|
||||
'grub/fs/fb.c',
|
||||
|
Loading…
x
Reference in New Issue
Block a user