From 5c35f6e3595aab4978a70f67b170562883d4eccd Mon Sep 17 00:00:00 2001 From: Nibble Date: Wed, 26 May 2010 01:42:22 +0200 Subject: [PATCH] * Rename {r_*_handle_t, R*Handle} to {r_*_plugin_t, R*Plugin} --- ChangeLog | 16 ++++++------- doc/fortunes | 2 +- libr/anal/anal.c | 8 +++---- libr/anal/p/anal_arm.c | 2 +- libr/anal/p/anal_csr.c | 2 +- libr/anal/p/anal_dummy.c | 2 +- libr/anal/p/anal_java.c | 2 +- libr/anal/p/anal_ppc.c | 2 +- libr/anal/p/anal_x86.c | 2 +- libr/anal/p/anal_x86_x86im.c | 2 +- libr/asm/arch/include/bfd.h | 6 ++--- libr/asm/arch/include/elf-bfd.h | 2 +- libr/asm/arch/mips/gnu/mips-dis.c | 4 ++-- libr/asm/arch/sparc/gnu/sparc-opc.c | 8 +++---- libr/asm/arch/x86/udis86/decode.c | 2 +- libr/asm/asm.c | 12 +++++----- libr/asm/p/asm_arm.c | 2 +- libr/asm/p/asm_avr.c | 2 +- libr/asm/p/asm_bf.c | 2 +- libr/asm/p/asm_csr.c | 2 +- libr/asm/p/asm_dummy.c | 2 +- libr/asm/p/asm_gas.c | 2 +- libr/asm/p/asm_java.c | 2 +- libr/asm/p/asm_mips.c | 2 +- libr/asm/p/asm_ppc.c | 2 +- libr/asm/p/asm_psosvm.c | 2 +- libr/asm/p/asm_sparc.c | 2 +- libr/asm/p/asm_x86.c | 2 +- libr/asm/p/asm_x86_nasm.c | 2 +- libr/asm/p/asm_x86_olly.c | 2 +- libr/asm/t/fastcall.c | 2 +- libr/asm/t/rasm2.c | 4 ++-- libr/bin/bin.c | 26 ++++++++++----------- libr/bin/format/pe/pe_specs.h | 2 +- libr/bin/p/bin_dummy.c | 2 +- libr/bin/p/bin_elf.c | 2 +- libr/bin/p/bin_elf64.c | 2 +- libr/bin/p/bin_java.c | 2 +- libr/bin/p/bin_mach0.c | 2 +- libr/bin/p/bin_mach064.c | 2 +- libr/bin/p/bin_pe.c | 2 +- libr/bin/p/bin_pe64.c | 2 +- libr/bin/t/rabin2.c | 2 +- libr/bp/bp.c | 2 +- libr/bp/handle.c | 10 ++++---- libr/bp/p/bp_arm.c | 2 +- libr/bp/p/bp_mips.c | 2 +- libr/bp/p/bp_ppc.c | 2 +- libr/bp/p/bp_x86.c | 2 +- libr/cmd/cmd.c | 4 ++-- libr/cmd/handle.c | 8 +++---- libr/cmd/p/cmd_dummy.c | 2 +- libr/cons/cons.c | 8 +++---- libr/cons/input.c | 2 +- libr/cons/output.c | 2 +- libr/core/cmd.c | 2 +- libr/core/config.c | 2 +- libr/core/libs.c | 18 +++++++-------- libr/crypto/crypto.c | 8 +++---- libr/crypto/p/crypto_aes.c | 2 +- libr/debug/handle.c | 12 +++++----- libr/debug/p/debug_gdb.c | 2 +- libr/debug/p/debug_native.c | 6 ++--- libr/debug/p/native/w32.c | 12 +++++----- libr/include/r_anal.h | 20 ++++++++-------- libr/include/r_asm.h | 36 ++++++++++++++--------------- libr/include/r_bin.h | 8 +++---- libr/include/r_bp.h | 18 +++++++-------- libr/include/r_cmd.h | 8 +++---- libr/include/r_crypto.h | 10 ++++---- libr/include/r_debug.h | 10 ++++---- libr/include/r_io.h | 36 ++++++++++++++--------------- libr/include/r_lang.h | 8 +++---- libr/include/r_parse.h | 14 +++++------ libr/include/r_syscall.h | 8 +++---- libr/io/README | 2 +- libr/io/desc.c | 2 +- libr/io/handle.c | 12 +++++----- libr/io/io.c | 4 ++-- libr/io/p/io_debug.c | 12 +++++----- libr/io/p/io_ewf.c | 4 ++-- libr/io/p/io_mach.c | 4 ++-- libr/io/p/io_malloc.c | 2 +- libr/io/p/io_procpid.c | 4 ++-- libr/io/p/io_ptrace.c | 4 ++-- libr/io/p/io_shm.c | 2 +- libr/io/p/io_w32dbg.c | 4 ++-- libr/io/undo.c | 2 +- libr/lang/lang.c | 6 ++--- libr/lang/p/dummy.c | 2 +- libr/lang/p/lua.c | 2 +- libr/lang/p/perl.c | 2 +- libr/lang/p/python.c | 2 +- libr/lang/p/ruby.c | 2 +- libr/lang/p/tcc.c | 2 +- libr/lib/lib.c | 2 +- libr/line/dietline.c | 2 +- libr/parse/p/parse_dummy.c | 2 +- libr/parse/p/parse_mreplace.c | 4 ++-- libr/parse/p/parse_x86_pseudo.c | 2 +- libr/parse/parse.c | 8 +++---- libr/syscall/win7.c | 22 +++++++++--------- libr/th/lock.c | 2 +- libr/util/w32-sys.c | 16 ++++++------- swig/vapi/r_asm.vapi | 6 ++--- swig/vapi/r_cmd.vapi | 6 ++--- swig/vapi/r_diff.vapi | 4 ++-- swig/vapi/r_io.vapi | 14 +++++------ swig/vapi/r_lang.vapi | 8 +++---- swig/vapi/r_lib.vapi | 4 ++-- swig/vapi/t/io.vala | 4 ++-- swig/vapi/t/plugin.vala | 2 +- 112 files changed, 312 insertions(+), 312 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6af4be03b..e4d0b595dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1064,7 +1064,7 @@ description: - dp=394 # is used to attach - dp 0 # to list all attachable pids - dp # list current used pid -* Added not-yet-implemented threads() callback in RDebugHandle +* Added not-yet-implemented threads() callback in RDebugPlugin * Fix r_list_free callback handler * Fix again the 'dr=' command :/ * Cleanup the help of 'd?' and 'dm', 'dp' @@ -1141,7 +1141,7 @@ description: * Lot of syntax cleanup to use the new code convention - Clean r_sign, r_search, r_syscall * Define global R_SYS_ARCH, _OS and _BITS - - Handle asm.os and asm.arch to hook r_syscall plugins + - Plugin asm.os and asm.arch to hook r_syscall plugins - Display 8 or 16 zeros depending on asm.bits - Added r_str_filter () to filter nonprintable chars @@ -1411,7 +1411,7 @@ description: * Implement native kill as a debugger callback * cmd.visual is now cmd.vprompt * Add r_debug_reg_{get|set} - - Handle register name aliases + - Plugin register name aliases - Works only with ut64 type * 'dr:eax' is now 'dr?eax' * Lot of random syntax cleanups @@ -1464,7 +1464,7 @@ date: Sun Feb 28 14:49:26 2010 +0100 files: libr/cons/cons.c libr/cons/input.c libr/core/config.c libr/core/visual.c libr/include/r_cons.h description: * Added patch from whats fixing the height in visual - - Handles WINCH signal in __UNIX__ to get size + - Plugins WINCH signal in __UNIX__ to get size - Some code cleanup @@ -3083,7 +3083,7 @@ user: pancake date: Thu Dec 31 01:20:08 2009 +0100 files: libr/core/visual.c description: -* Handle arrow keys in visual (thx whats) +* Plugin arrow keys in visual (thx whats) changeset: 292:2d67b9c2a1bc @@ -3310,7 +3310,7 @@ files: TODO libr/core/cmd.c libr/core/file.c libr/core/t/radare2.c libr/de description: * Drop PFX in debug plugin names * Minor cosmetic fixups -* Handle binmask==NULL in all _add methods of r_search +* Plugin binmask==NULL in all _add methods of r_search - Added empty declarations of reset() and kw_reset() * Various random fixes in some vapis @@ -4588,7 +4588,7 @@ files: libr/debug/Makefile libr/debug/debug.c libr/debug/p/dbg_ptrace.c li description: * Initial work on the register API for r_debug - r_debug_reg and r_debug_regset - - Handles dbg->newstate to force register sync + - Plugins dbg->newstate to force register sync - Only dbg.reg.read() for x86-32 and 64 * Added dummy copy of manpages (from old radare1) @@ -6170,7 +6170,7 @@ description: * Fix a bug in the regexp algorithm that can get into infinite loop * Binmask can now contain non hexpair values * Add '/m' search regexp matches using the new R_SEARCH_REGEXP algorithm - - Handle ^C in search loop..needs to use callback method + - Plugin ^C in search loop..needs to use callback method * Properly cleanup the flag names * Added asm.bits and asm.os eval vars * Added some random tips for debug in README diff --git a/doc/fortunes b/doc/fortunes index a2fabb4486..fca7efc387 100644 --- a/doc/fortunes +++ b/doc/fortunes @@ -72,7 +72,7 @@ Control the height of the terminal on serial consoles with eval scr.height Use eval file.id=true and eval file.flag=true in your ~/.radarerc to get symbols, strings, .. when loading Disassemble unsupported architectures with external objdump defined in eval asm.objdump. Use 'pd' command. Emulate the base address of a file with eval file.baddr -Dump the class header information with 'javasm -c '. Handled by radare if file.id=true +Dump the class header information with 'javasm -c '. Plugind by radare if file.id=true Use gradare if you prefer simple frontend for gui users Feedback, bug reports, patches, ideas are welcome to the mailing list at radare.nopcode.org Bindiff two files with '$ bdiff /bin/true /bin/false' diff --git a/libr/anal/anal.c b/libr/anal/anal.c index cf334ff3fa..433547b5dc 100644 --- a/libr/anal/anal.c +++ b/libr/anal/anal.c @@ -7,7 +7,7 @@ #include #include "../config.h" -static RAnalHandle *anal_static_plugins[] = +static RAnalPlugin *anal_static_plugins[] = { R_ANAL_STATIC_PLUGINS }; static RAnalVarType anal_default_vartypes[] = @@ -59,7 +59,7 @@ R_API void r_anal_set_user_ptr(RAnal *anal, void *user) { anal->user = user; } -R_API int r_anal_add(RAnal *anal, RAnalHandle *foo) { +R_API int r_anal_add(RAnal *anal, RAnalPlugin *foo) { if (foo->init) foo->init(anal->user); list_add_tail(&(foo->list), &(anal->anals)); @@ -70,7 +70,7 @@ R_API int r_anal_add(RAnal *anal, RAnalHandle *foo) { R_API int r_anal_list(RAnal *anal) { struct list_head *pos; list_for_each_prev(pos, &anal->anals) { - RAnalHandle *h = list_entry(pos, RAnalHandle, list); + RAnalPlugin *h = list_entry(pos, RAnalPlugin, list); printf (" %s: %s\n", h->name, h->desc); } return R_FALSE; @@ -79,7 +79,7 @@ R_API int r_anal_list(RAnal *anal) { R_API int r_anal_use(RAnal *anal, const char *name) { struct list_head *pos; list_for_each_prev (pos, &anal->anals) { - RAnalHandle *h = list_entry(pos, RAnalHandle, list); + RAnalPlugin *h = list_entry(pos, RAnalPlugin, list); if (!strcmp (h->name, name)) { anal->cur = h; return R_TRUE; diff --git a/libr/anal/p/anal_arm.c b/libr/anal/p/anal_arm.c index 3dab832375..3dc1b15cec 100644 --- a/libr/anal/p/anal_arm.c +++ b/libr/anal/p/anal_arm.c @@ -160,7 +160,7 @@ static int aop(RAnal *anal, RAnalOp *aop, ut64 addr, const ut8 *data, int len) { return (arm_mode==16)?2:4; } -struct r_anal_handle_t r_anal_plugin_arm = { +struct r_anal_plugin_t r_anal_plugin_arm = { .name = "arm", .desc = "ARM code analysis plugin", .init = NULL, diff --git a/libr/anal/p/anal_csr.c b/libr/anal/p/anal_csr.c index b0d5c22c1a..26cf89ce7d 100644 --- a/libr/anal/p/anal_csr.c +++ b/libr/anal/p/anal_csr.c @@ -222,7 +222,7 @@ static int aop(RAnal *anal, RAnalOp *aop, ut64 addr, const ut8 *bytes, int len) return aop->length; } -struct r_anal_handle_t r_anal_plugin_csr = { +struct r_anal_plugin_t r_anal_plugin_csr = { .name = "csr", .desc = "CSR code analysis plugin", .init = NULL, diff --git a/libr/anal/p/anal_dummy.c b/libr/anal/p/anal_dummy.c index 73628a72b5..004e0fa6a3 100644 --- a/libr/anal/p/anal_dummy.c +++ b/libr/anal/p/anal_dummy.c @@ -4,7 +4,7 @@ #include #include -struct r_anal_handle_t r_anal_plugin_dummy = { +struct r_anal_plugin_t r_anal_plugin_dummy = { .name = "dummy", .desc = "Dummy analysis plugin", .init = NULL, diff --git a/libr/anal/p/anal_java.c b/libr/anal/p/anal_java.c index b98f1d1a8c..b54fd9743d 100644 --- a/libr/anal/p/anal_java.c +++ b/libr/anal/p/anal_java.c @@ -173,7 +173,7 @@ static int aop(RAnal *anal, RAnalOp *aop, ut64 addr, const ut8 *data, int len) { return sz; } -struct r_anal_handle_t r_anal_plugin_java = { +struct r_anal_plugin_t r_anal_plugin_java = { .name = "java", .desc = "Java bytecode analysis plugin", .init = NULL, diff --git a/libr/anal/p/anal_ppc.c b/libr/anal/p/anal_ppc.c index d615e2ea7f..854be1073a 100644 --- a/libr/anal/p/anal_ppc.c +++ b/libr/anal/p/anal_ppc.c @@ -74,7 +74,7 @@ int aop(RAnal *anal, RAnalOp *aop, ut64 addr, const ut8 *bytes, int len) { return aop->length; } -struct r_anal_handle_t r_anal_plugin_ppc = { +struct r_anal_plugin_t r_anal_plugin_ppc = { .name = "ppc", .desc = "PowerPC analysis plugin", .init = NULL, diff --git a/libr/anal/p/anal_x86.c b/libr/anal/p/anal_x86.c index 6c4c729fca..40e5570a7c 100644 --- a/libr/anal/p/anal_x86.c +++ b/libr/anal/p/anal_x86.c @@ -405,7 +405,7 @@ static int aop(RAnal *anal, RAnalOp *aop, ut64 addr, const ut8 *data, int len) { return aop->length; } -struct r_anal_handle_t r_anal_plugin_x86 = { +struct r_anal_plugin_t r_anal_plugin_x86 = { .name = "x86", .desc = "X86 analysis plugin", .init = NULL, diff --git a/libr/anal/p/anal_x86_x86im.c b/libr/anal/p/anal_x86_x86im.c index e01b97960b..dca8a32b40 100644 --- a/libr/anal/p/anal_x86_x86im.c +++ b/libr/anal/p/anal_x86_x86im.c @@ -186,7 +186,7 @@ static int aop(RAnal *anal, RAnalOp *aop, ut64 addr, const ut8 *data, int len) { return aop->length; } -struct r_anal_handle_t r_anal_plugin_x86_x86im = { +struct r_anal_plugin_t r_anal_plugin_x86_x86im = { .name = "x86_x86im", .desc = "X86 x86im analysis plugin", .init = NULL, diff --git a/libr/asm/arch/include/bfd.h b/libr/asm/arch/include/bfd.h index 1e67d81b2c..896a1d8985 100644 --- a/libr/asm/arch/include/bfd.h +++ b/libr/asm/arch/include/bfd.h @@ -4544,13 +4544,13 @@ const char *bfd_errmsg (bfd_error_type error_tag); void bfd_perror (const char *message); -typedef void (*bfd_error_handler_type) (const char *, ...); +typedef void (*bfd_error_plugin_type) (const char *, ...); -bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); +bfd_error_plugin_type bfd_set_error_handler (bfd_error_plugin_type); void bfd_set_error_program_name (const char *); -bfd_error_handler_type bfd_get_error_handler (void); +bfd_error_plugin_type bfd_get_error_handler (void); long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); diff --git a/libr/asm/arch/include/elf-bfd.h b/libr/asm/arch/include/elf-bfd.h index dffb83b8ee..17644fb6df 100644 --- a/libr/asm/arch/include/elf-bfd.h +++ b/libr/asm/arch/include/elf-bfd.h @@ -1060,7 +1060,7 @@ struct elf_backend_data bfd_boolean (*is_function_type) (unsigned int type); /* Used to handle bad SHF_LINK_ORDER input. */ - bfd_error_handler_type link_order_error_handler; + bfd_error_plugin_type link_order_error_handler; /* Name of the PLT relocation section. */ const char *relplt_name; diff --git a/libr/asm/arch/mips/gnu/mips-dis.c b/libr/asm/arch/mips/gnu/mips-dis.c index 6d4a21ea03..8ce2df0e55 100644 --- a/libr/asm/arch/mips/gnu/mips-dis.c +++ b/libr/asm/arch/mips/gnu/mips-dis.c @@ -1363,7 +1363,7 @@ print_insn_mips (bfd_vma memaddr, } } - /* Handle undefined instructions. */ + /* Plugin undefined instructions. */ info->insn_type = dis_noninsn; (*info->fprintf_func) (info->stream, "0x%lx", word); return INSNLEN; @@ -1907,7 +1907,7 @@ print_insn_mips16 (bfd_vma memaddr, struct disassemble_info *info) else insn = bfd_getl16 (buffer); - /* Handle the extend opcode specially. */ + /* Plugin the extend opcode specially. */ use_extend = FALSE; if ((insn & 0xf800) == 0xf000) { diff --git a/libr/asm/arch/sparc/gnu/sparc-opc.c b/libr/asm/arch/sparc/gnu/sparc-opc.c index 1800ea97f5..6f1ca6df8b 100644 --- a/libr/asm/arch/sparc/gnu/sparc-opc.c +++ b/libr/asm/arch/sparc/gnu/sparc-opc.c @@ -1864,7 +1864,7 @@ lookup_value (const arg *table, int value) return NULL; } -/* Handle ASI's. */ +/* Plugin ASI's. */ static arg asi_table[] = { @@ -1922,7 +1922,7 @@ sparc_decode_asi (int value) return lookup_value (asi_table, value); } -/* Handle membar masks. */ +/* Plugin membar masks. */ static arg membar_table[] = { @@ -1952,7 +1952,7 @@ sparc_decode_membar (int value) return lookup_value (membar_table, value); } -/* Handle prefetch args. */ +/* Plugin prefetch args. */ static arg prefetch_table[] = { @@ -1981,7 +1981,7 @@ sparc_decode_prefetch (int value) return lookup_value (prefetch_table, value); } -/* Handle sparclet coprocessor registers. */ +/* Plugin sparclet coprocessor registers. */ static arg sparclet_cpreg_table[] = { diff --git a/libr/asm/arch/x86/udis86/decode.c b/libr/asm/arch/x86/udis86/decode.c index 70fa9adf50..846a6b4fdd 100644 --- a/libr/asm/arch/x86/udis86/decode.c +++ b/libr/asm/arch/x86/udis86/decode.c @@ -1168,7 +1168,7 @@ unsigned int ud_decode( struct ud* u ) ; /* error */ } - /* Handle decode error. */ + /* Plugin decode error. */ if ( u->error ) { /* clear out the decode data. */ clear_insn( u ); diff --git a/libr/asm/asm.c b/libr/asm/asm.c index 3af8d8b40e..09725d6ca5 100644 --- a/libr/asm/asm.c +++ b/libr/asm/asm.c @@ -8,7 +8,7 @@ #include #include "../config.h" -static RAsmHandler *asm_static_plugins[] = +static RAsmPlugin *asm_static_plugins[] = { R_ASM_STATIC_PLUGINS }; static int r_asm_pseudo_string(struct r_asm_aop_t *aop, char *input) { @@ -81,9 +81,9 @@ R_API void r_asm_set_user_ptr(RAsm *a, void *user) { a->user = user; } -R_API int r_asm_add(RAsm *a, RAsmHandler *foo) { +R_API int r_asm_add(RAsm *a, RAsmPlugin *foo) { RListIter *iter; - RAsmHandler *h; + RAsmPlugin *h; // TODO: cache foo->name length and use memcmp instead of strcmp if (foo->init) foo->init (a->user); @@ -101,7 +101,7 @@ R_API int r_asm_del(RAsm *a, const char *name) { // TODO: this can be optimized using r_str_hash() R_API int r_asm_use(RAsm *a, const char *name) { - RAsmHandler *h; + RAsmPlugin *h; RListIter *iter; r_list_foreach (a->handlers, iter, h) if (!strcmp (h->name, name)) { @@ -118,7 +118,7 @@ R_API int r_asm_set_subarch(RAsm *a, const char *name) { return ret; } -static int has_bits(RAsmHandler *h, int bits) { +static int has_bits(RAsmPlugin *h, int bits) { int i; if (h && h->bits) for(i=0; h->bits[i]; i++) @@ -169,7 +169,7 @@ R_API int r_asm_disassemble(RAsm *a, struct r_asm_aop_t *aop, ut8 *buf, ut64 len R_API int r_asm_assemble(RAsm *a, struct r_asm_aop_t *aop, const char *buf) { int ret = 0; - RAsmHandler *h; + RAsmPlugin *h; RListIter *iter; if (a->cur) { if (!a->cur->assemble) { diff --git a/libr/asm/p/asm_arm.c b/libr/asm/p/asm_arm.c index 04b41f22ed..d26aade8d1 100644 --- a/libr/asm/p/asm_arm.c +++ b/libr/asm/p/asm_arm.c @@ -79,7 +79,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6 return aop->inst_len; } -RAsmHandler r_asm_plugin_arm = { +RAsmPlugin r_asm_plugin_arm = { .name = "arm", .arch = "arm", .bits = (int[]){ 16, 32, 0 }, diff --git a/libr/asm/p/asm_avr.c b/libr/asm/p/asm_avr.c index a3bfbd9e13..29a6460f41 100644 --- a/libr/asm/p/asm_avr.c +++ b/libr/asm/p/asm_avr.c @@ -15,7 +15,7 @@ static int disassemble(RAsm *a, RAsmAop *aop, ut8 *buf, ut64 len) { return aop->inst_len = avrdis (aop->buf_asm, a->pc, buf, len); } -RAsmHandler r_asm_plugin_avr = { +RAsmPlugin r_asm_plugin_avr = { .name = "avr", .arch = "avr", .bits = (int[]){ 16, 32, 0 }, diff --git a/libr/asm/p/asm_bf.c b/libr/asm/p/asm_bf.c index 995db0a9f0..3014c3cf13 100644 --- a/libr/asm/p/asm_bf.c +++ b/libr/asm/p/asm_bf.c @@ -62,7 +62,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6 return i; } -RAsmHandler r_asm_plugin_bf = { +RAsmPlugin r_asm_plugin_bf = { .name = "bf", .arch = "brainfuck", .bits = (int[]){ 8, 0 }, diff --git a/libr/asm/p/asm_csr.c b/libr/asm/p/asm_csr.c index 858f832614..4898f98cb6 100644 --- a/libr/asm/p/asm_csr.c +++ b/libr/asm/p/asm_csr.c @@ -13,7 +13,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6 return (aop->inst_len=2); } -RAsmHandler r_asm_plugin_csr = { +RAsmPlugin r_asm_plugin_csr = { .name = "csr", .arch = "csr", .bits = (int[]){ 16, 0 }, diff --git a/libr/asm/p/asm_dummy.c b/libr/asm/p/asm_dummy.c index ed98dc0553..80ab578da1 100644 --- a/libr/asm/p/asm_dummy.c +++ b/libr/asm/p/asm_dummy.c @@ -12,7 +12,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6 return R_FALSE; } -RAsmHandler r_asm_plugin_dummy = { +RAsmPlugin r_asm_plugin_dummy = { .name = "dummy", .arch = "none", .bits = (int[]){ 0 }, diff --git a/libr/asm/p/asm_gas.c b/libr/asm/p/asm_gas.c index 72180ecbcc..e13c189cc1 100644 --- a/libr/asm/p/asm_gas.c +++ b/libr/asm/p/asm_gas.c @@ -28,7 +28,7 @@ static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf) return len; } -RAsmHandler r_asm_plugin_x86_nasm = { +RAsmPlugin r_asm_plugin_x86_nasm = { .name = "gas", .desc = "GNU Assembler plugin", .arch = "x86", // XXX diff --git a/libr/asm/p/asm_java.c b/libr/asm/p/asm_java.c index aeebba0d60..d5db59b34d 100644 --- a/libr/asm/p/asm_java.c +++ b/libr/asm/p/asm_java.c @@ -17,7 +17,7 @@ static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf) return aop->inst_len = java_assemble(aop->buf, buf); } -RAsmHandler r_asm_plugin_java = { +RAsmPlugin r_asm_plugin_java = { .name = "java", .desc = "Java CLASS assembler/disassembler", .arch = "java", diff --git a/libr/asm/p/asm_mips.c b/libr/asm/p/asm_mips.c index fed4ea735b..9bcdd62f9b 100644 --- a/libr/asm/p/asm_mips.c +++ b/libr/asm/p/asm_mips.c @@ -86,7 +86,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6 return aop->inst_len; } -RAsmHandler r_asm_plugin_mips = { +RAsmPlugin r_asm_plugin_mips = { .name = "mips", .arch = "mips", .bits = (int[]){ 32, 0 }, diff --git a/libr/asm/p/asm_ppc.c b/libr/asm/p/asm_ppc.c index ae1928eb0b..02fbcadf01 100644 --- a/libr/asm/p/asm_ppc.c +++ b/libr/asm/p/asm_ppc.c @@ -82,7 +82,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6 return aop->inst_len; } -RAsmHandler r_asm_plugin_ppc = { +RAsmPlugin r_asm_plugin_ppc = { .name = "ppc", .arch = "ppc", .bits = (int[]){ 32, 0 }, diff --git a/libr/asm/p/asm_psosvm.c b/libr/asm/p/asm_psosvm.c index 89256abacc..dc9d8799f3 100644 --- a/libr/asm/p/asm_psosvm.c +++ b/libr/asm/p/asm_psosvm.c @@ -18,7 +18,7 @@ static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf) return aop->inst_len; } -RAsmHandler r_asm_plugin_psosvm = { +RAsmPlugin r_asm_plugin_psosvm = { .name = "psosvm", .desc = "PSOS-VM disassembly plugin", .arch = "psosvm", diff --git a/libr/asm/p/asm_sparc.c b/libr/asm/p/asm_sparc.c index 786648d5cc..29981060e2 100644 --- a/libr/asm/p/asm_sparc.c +++ b/libr/asm/p/asm_sparc.c @@ -85,7 +85,7 @@ static int disassemble(struct r_asm_t *a, struct r_asm_aop_t *aop, ut8 *buf, ut6 return aop->inst_len; } -RAsmHandler r_asm_plugin_sparc = { +RAsmPlugin r_asm_plugin_sparc = { .name = "sparc", .arch = "sparc", .bits = (int[]){ 32, 0 }, diff --git a/libr/asm/p/asm_x86.c b/libr/asm/p/asm_x86.c index 5d5955292f..0b5b587106 100644 --- a/libr/asm/p/asm_x86.c +++ b/libr/asm/p/asm_x86.c @@ -61,7 +61,7 @@ static int disassemble(RAsm *a, RAsmAop *aop, ut8 *buf, ut64 len) { return aop->inst_len; } -RAsmHandler r_asm_plugin_x86 = { +RAsmPlugin r_asm_plugin_x86 = { .name = "x86", .desc = "udis86 disassembly plugin", .arch = "x86", diff --git a/libr/asm/p/asm_x86_nasm.c b/libr/asm/p/asm_x86_nasm.c index 55dbfeae06..2fb7dbd71e 100644 --- a/libr/asm/p/asm_x86_nasm.c +++ b/libr/asm/p/asm_x86_nasm.c @@ -32,7 +32,7 @@ static int assemble(RAsm *a, RAsmAop *aop, const char *buf) { return len; } -RAsmHandler r_asm_plugin_x86_nasm = { +RAsmPlugin r_asm_plugin_x86_nasm = { .name = "x86.nasm", .desc = "X86 nasm assembler plugin", .arch = "x86", diff --git a/libr/asm/p/asm_x86_olly.c b/libr/asm/p/asm_x86_olly.c index 190e1a2151..b50e62bde3 100644 --- a/libr/asm/p/asm_x86_olly.c +++ b/libr/asm/p/asm_x86_olly.c @@ -46,7 +46,7 @@ static int assemble(struct r_asm_t *a, struct r_asm_aop_t *aop, const char *buf) return aop->inst_len; } -RAsmHandler r_asm_plugin_x86_olly = { +RAsmPlugin r_asm_plugin_x86_olly = { .name = "x86.olly", .desc = "X86 disassembly plugin (olly engine)", .arch = "x86", diff --git a/libr/asm/t/fastcall.c b/libr/asm/t/fastcall.c index d07acdb67a..dd093c11a0 100644 --- a/libr/asm/t/fastcall.c +++ b/libr/asm/t/fastcall.c @@ -1,7 +1,7 @@ #include "r_asm.h" static void r_asm_list(RAsm *a) { - RAsmHandler *h; + RAsmPlugin *h; RListIter *iter; r_list_foreach (a->handlers, iter, h) printf ("asm %s\t %s\n", h->name, h->desc); diff --git a/libr/asm/t/rasm2.c b/libr/asm/t/rasm2.c index e00b593b23..194cd8887c 100644 --- a/libr/asm/t/rasm2.c +++ b/libr/asm/t/rasm2.c @@ -15,7 +15,7 @@ static int coutput = R_FALSE; // TODO: remove or gtfo static void r_asm_list(RAsm *a) { - RAsmHandler *h; + RAsmPlugin *h; RListIter *iter; r_list_foreach (a->handlers, iter, h) printf ("asm %s\t %s\n", h->name, h->desc); @@ -126,7 +126,7 @@ static int rasm_asm(char *buf, ut64 offset, ut64 len, int bin) { /* asm callback */ static int __lib_asm_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - RAsmHandle *hand = (struct r_asm_handle_t *)data; + RAsmPlugin *hand = (struct r_asm_plugin_t *)data; r_asm_add (a, hand); return R_TRUE; } diff --git a/libr/bin/bin.c b/libr/bin/bin.c index 46df16b36f..bdad144c55 100644 --- a/libr/bin/bin.c +++ b/libr/bin/bin.c @@ -13,16 +13,16 @@ #include "../config.h" /* plugin pointers */ -extern RBinHandler r_bin_plugin_elf; -extern RBinHandler r_bin_plugin_elf64; -extern RBinHandler r_bin_plugin_pe; -extern RBinHandler r_bin_plugin_pe64; -extern RBinHandler r_bin_plugin_mach0; -extern RBinHandler r_bin_plugin_mach064; -extern RBinHandler r_bin_plugin_java; -extern RBinHandler r_bin_plugin_dummy; +extern RBinPlugin r_bin_plugin_elf; +extern RBinPlugin r_bin_plugin_elf64; +extern RBinPlugin r_bin_plugin_pe; +extern RBinPlugin r_bin_plugin_pe64; +extern RBinPlugin r_bin_plugin_mach0; +extern RBinPlugin r_bin_plugin_mach064; +extern RBinPlugin r_bin_plugin_java; +extern RBinPlugin r_bin_plugin_dummy; -static RBinHandler *bin_static_plugins[] = { R_BIN_STATIC_PLUGINS }; +static RBinPlugin *bin_static_plugins[] = { R_BIN_STATIC_PLUGINS }; static RList* get_strings(RBin *bin, int min) { RList *ret; @@ -104,12 +104,12 @@ static void r_bin_free_items(RBin *bin) { r_list_free (bin->symbols); } -R_API int r_bin_add(RBin *bin, RBinHandler *foo) { +R_API int r_bin_add(RBin *bin, RBinPlugin *foo) { struct list_head *pos; if (foo->init) foo->init (bin->user); list_for_each_prev (pos, &bin->bins) { - RBinHandler *h = list_entry (pos, RBinHandler, list); + RBinPlugin *h = list_entry (pos, RBinPlugin, list); if (!strcmp (h->name, foo->name)) return R_FALSE; } @@ -131,7 +131,7 @@ R_API int r_bin_list(RBin *bin) { struct list_head *pos; list_for_each_prev(pos, &bin->bins) { - RBinHandler *h = list_entry (pos, RBinHandler, list); + RBinPlugin *h = list_entry (pos, RBinPlugin, list); printf ("bin %-10s %s\n", h->name, h->desc); } return R_FALSE; @@ -143,7 +143,7 @@ R_API int r_bin_load(RBin *bin, const char *file, const char *plugin_name) { return R_FALSE; bin->file = r_file_abspath (file); list_for_each (pos, &bin->bins) { - RBinHandler *h = list_entry (pos, RBinHandler, list); + RBinPlugin *h = list_entry (pos, RBinPlugin, list); if ((plugin_name && !strcmp (h->name, plugin_name)) || (h->check && h->check (bin))) bin->cur = h; diff --git a/libr/bin/format/pe/pe_specs.h b/libr/bin/format/pe/pe_specs.h index 7848c675c6..5f06af6c3e 100644 --- a/libr/bin/format/pe/pe_specs.h +++ b/libr/bin/format/pe/pe_specs.h @@ -266,7 +266,7 @@ typedef struct { typedef struct { ut32 Attributes; ut32 Name; - ut32 ModuleHandle; + ut32 ModulePlugin; ut32 DelayImportAddressTable; ut32 DelayImportNameTable; ut32 BoundDelayImportTable; diff --git a/libr/bin/p/bin_dummy.c b/libr/bin/p/bin_dummy.c index b19cb8ef5d..f85d75491a 100644 --- a/libr/bin/p/bin_dummy.c +++ b/libr/bin/p/bin_dummy.c @@ -27,7 +27,7 @@ static ut64 baddr(RBin *bin) { return 0LL; } -struct r_bin_handle_t r_bin_plugin_dummy = { +struct r_bin_plugin_t r_bin_plugin_dummy = { .name = "dummy", .desc = "dummy bin plugin", .init = NULL, diff --git a/libr/bin/p/bin_elf.c b/libr/bin/p/bin_elf.c index dc8936feba..e25730d1ef 100644 --- a/libr/bin/p/bin_elf.c +++ b/libr/bin/p/bin_elf.c @@ -235,7 +235,7 @@ static int check(RBin *bin) { extern struct r_bin_meta_t r_bin_meta_elf; extern struct r_bin_write_t r_bin_write_elf; -struct r_bin_handle_t r_bin_plugin_elf = { +struct r_bin_plugin_t r_bin_plugin_elf = { .name = "elf", .desc = "ELF format r_bin plugin", .init = NULL, diff --git a/libr/bin/p/bin_elf64.c b/libr/bin/p/bin_elf64.c index 5eb929a09b..eddf959b28 100644 --- a/libr/bin/p/bin_elf64.c +++ b/libr/bin/p/bin_elf64.c @@ -19,7 +19,7 @@ static int check(RBin *bin) { extern struct r_bin_meta_t r_bin_meta_elf64; extern struct r_bin_write_t r_bin_write_elf64; -struct r_bin_handle_t r_bin_plugin_elf64 = { +struct r_bin_plugin_t r_bin_plugin_elf64 = { .name = "elf64", .desc = "elf64 bin plugin", .init = NULL, diff --git a/libr/bin/p/bin_java.c b/libr/bin/p/bin_java.c index 164ae43005..9ded789034 100644 --- a/libr/bin/p/bin_java.c +++ b/libr/bin/p/bin_java.c @@ -123,7 +123,7 @@ static int check(RBin *bin) { return ret; } -struct r_bin_handle_t r_bin_plugin_java = { +struct r_bin_plugin_t r_bin_plugin_java = { .name = "java", .desc = "java bin plugin", .init = NULL, diff --git a/libr/bin/p/bin_mach0.c b/libr/bin/p/bin_mach0.c index 5050c2da8f..e4c3d7ef7b 100644 --- a/libr/bin/p/bin_mach0.c +++ b/libr/bin/p/bin_mach0.c @@ -194,7 +194,7 @@ static int check(RBin *bin) { return ret; } -struct r_bin_handle_t r_bin_plugin_mach0 = { +struct r_bin_plugin_t r_bin_plugin_mach0 = { .name = "mach0", .desc = "mach0 bin plugin", .init = NULL, diff --git a/libr/bin/p/bin_mach064.c b/libr/bin/p/bin_mach064.c index 07bbe26a13..b2fa40b478 100644 --- a/libr/bin/p/bin_mach064.c +++ b/libr/bin/p/bin_mach064.c @@ -16,7 +16,7 @@ static int check(RBin *bin) { return ret; } -struct r_bin_handle_t r_bin_plugin_mach064 = { +struct r_bin_plugin_t r_bin_plugin_mach064 = { .name = "mach064", .desc = "mach064 bin plugin", .init = NULL, diff --git a/libr/bin/p/bin_pe.c b/libr/bin/p/bin_pe.c index d3433a9015..3dcdbbc946 100644 --- a/libr/bin/p/bin_pe.c +++ b/libr/bin/p/bin_pe.c @@ -213,7 +213,7 @@ static int check(RBin *bin) { return ret; } -struct r_bin_handle_t r_bin_plugin_pe = { +struct r_bin_plugin_t r_bin_plugin_pe = { .name = "pe", .desc = "PE bin plugin", .init = NULL, diff --git a/libr/bin/p/bin_pe64.c b/libr/bin/p/bin_pe64.c index 36d210181e..f513182e14 100644 --- a/libr/bin/p/bin_pe64.c +++ b/libr/bin/p/bin_pe64.c @@ -19,7 +19,7 @@ static int check(RBin *bin) { return ret; } -struct r_bin_handle_t r_bin_plugin_pe64 = { +struct r_bin_plugin_t r_bin_plugin_pe64 = { .name = "pe64", .desc = "PE64 (PE32+) bin plugin", .init = NULL, diff --git a/libr/bin/t/rabin2.c b/libr/bin/t/rabin2.c index 59339ef645..c4e18cb656 100644 --- a/libr/bin/t/rabin2.c +++ b/libr/bin/t/rabin2.c @@ -501,7 +501,7 @@ static int rabin_show_srcline(ut64 at) { /* bin callback */ static int __lib_bin_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_bin_handle_t *hand = (struct r_bin_handle_t *)data; + struct r_bin_plugin_t *hand = (struct r_bin_plugin_t *)data; //printf(" * Added (dis)assembly handler\n"); r_bin_add (bin, hand); return R_TRUE; diff --git a/libr/bp/bp.c b/libr/bp/bp.c index 8889f55e0b..c73c872c1f 100644 --- a/libr/bp/bp.c +++ b/libr/bp/bp.c @@ -3,7 +3,7 @@ #include #include "../config.h" -static struct r_bp_handle_t *bp_static_plugins[] = +static struct r_bp_plugin_t *bp_static_plugins[] = { R_BP_STATIC_PLUGINS }; R_API RBreakpoint *r_bp_new() { diff --git a/libr/bp/handle.c b/libr/bp/handle.c index ce75290832..46963c6ea4 100644 --- a/libr/bp/handle.c +++ b/libr/bp/handle.c @@ -8,7 +8,7 @@ R_API int r_bp_handle_del(struct r_bp_t *bp, const char *name) return R_FALSE; } -R_API int r_bp_handle_add(struct r_bp_t *bp, struct r_bp_handle_t *foo) +R_API int r_bp_handle_add(struct r_bp_t *bp, struct r_bp_plugin_t *foo) { struct list_head *pos; if (bp == NULL) { @@ -17,7 +17,7 @@ R_API int r_bp_handle_add(struct r_bp_t *bp, struct r_bp_handle_t *foo) } /* avoid dupped plugins */ list_for_each_prev (pos, &bp->bps) { - struct r_bp_handle_t *h = list_entry (pos, struct r_bp_handle_t, list); + struct r_bp_plugin_t *h = list_entry (pos, struct r_bp_plugin_t, list); if (!strcmp (h->name, foo->name)) return R_FALSE; } @@ -30,7 +30,7 @@ R_API int r_bp_use(struct r_bp_t *bp, const char *name) { struct list_head *pos; list_for_each_prev (pos, &bp->plugins) { - struct r_bp_handle_t *h = list_entry(pos, struct r_bp_handle_t, list); + struct r_bp_plugin_t *h = list_entry(pos, struct r_bp_plugin_t, list); if (!strcmp (h->name, name)) { bp->cur = h; return R_TRUE; @@ -41,10 +41,10 @@ R_API int r_bp_use(struct r_bp_t *bp, const char *name) // TODO: deprecate R_API void r_bp_handle_list(struct r_bp_t *bp) { - struct r_bp_handle_t *b; + struct r_bp_plugin_t *b; struct list_head *pos; list_for_each (pos, &bp->plugins) { - b = list_entry(pos, struct r_bp_handle_t, list); + b = list_entry(pos, struct r_bp_plugin_t, list); printf ("bp %c %s\n", (bp->cur && !strcmp (bp->cur->name, b->name))?'*':'-', b->name); diff --git a/libr/bp/p/bp_arm.c b/libr/bp/p/bp_arm.c index af0e693bc4..03366cb1b7 100644 --- a/libr/bp/p/bp_arm.c +++ b/libr/bp/p/bp_arm.c @@ -16,7 +16,7 @@ static struct r_bp_arch_t r_bp_plugin_arm_bps[] = { { 2, 1, (const ut8*)"\xdf\xfe" } // arm-thumb-be }; -struct r_bp_handle_t r_bp_plugin_arm = { +struct r_bp_plugin_t r_bp_plugin_arm = { .name = "arm", .arch = "arm", .nbps = 10, diff --git a/libr/bp/p/bp_mips.c b/libr/bp/p/bp_mips.c index def9c0f38a..b26dbc5eda 100644 --- a/libr/bp/p/bp_mips.c +++ b/libr/bp/p/bp_mips.c @@ -8,7 +8,7 @@ static struct r_bp_arch_t r_bp_plugin_mips_bps[] = { { 4, 1, (const ut8*)"\x0d\x00\x00\x00" }, // big endian }; -struct r_bp_handle_t r_bp_plugin_mips = { +struct r_bp_plugin_t r_bp_plugin_mips = { .name = "mips", .arch = "mips", .nbps = 2, diff --git a/libr/bp/p/bp_ppc.c b/libr/bp/p/bp_ppc.c index 877ce5128e..4273d18621 100644 --- a/libr/bp/p/bp_ppc.c +++ b/libr/bp/p/bp_ppc.c @@ -9,7 +9,7 @@ static struct r_bp_arch_t r_bp_plugin_ppc_bps[] = { { 4, 1, (const ut8*)"\x0d\x00\x00\x00" }, // big endian }; -struct r_bp_handle_t r_bp_plugin_ppc = { +struct r_bp_plugin_t r_bp_plugin_ppc = { .name = "ppc", .arch = "ppc", .nbps = 2, diff --git a/libr/bp/p/bp_x86.c b/libr/bp/p/bp_x86.c index 804cbb055c..ce20e38ba4 100644 --- a/libr/bp/p/bp_x86.c +++ b/libr/bp/p/bp_x86.c @@ -9,7 +9,7 @@ static struct r_bp_arch_t r_bp_plugin_x86_bps[] = { { 0, 0, NULL }, }; -struct r_bp_handle_t r_bp_plugin_x86 = { +struct r_bp_plugin_t r_bp_plugin_x86 = { .name = "x86", .arch = "x86", .nbps = 2, diff --git a/libr/cmd/cmd.c b/libr/cmd/cmd.c index 9140036b52..8b9d4a38f1 100644 --- a/libr/cmd/cmd.c +++ b/libr/cmd/cmd.c @@ -67,11 +67,11 @@ R_API int r_cmd_call(struct r_cmd_t *cmd, const char *input) { struct r_cmd_item_t *c; int ret = -1; RListIter *iter; - RCmdHandle *cp; + RCmdPlugin *cp; iter = r_list_iterator (cmd->plist); while (r_list_iter_next (iter)) { - cp = (RCmdHandle*) r_list_iter_get (iter); + cp = (RCmdPlugin*) r_list_iter_get (iter); if (cp->call (cmd->data, input)) return R_TRUE; } diff --git a/libr/cmd/handle.c b/libr/cmd/handle.c index 9bf91fd1ec..b57ab28b84 100644 --- a/libr/cmd/handle.c +++ b/libr/cmd/handle.c @@ -7,10 +7,10 @@ #include #include -static struct r_cmd_handle_t *cmd_static_plugins[] = +static struct r_cmd_plugin_t *cmd_static_plugins[] = { R_CMD_STATIC_PLUGINS }; -R_API int r_cmd_handle_add(struct r_cmd_t *cmd, struct r_cmd_handle_t *plugin) { +R_API int r_cmd_handle_add(struct r_cmd_t *cmd, struct r_cmd_plugin_t *plugin) { r_list_append (cmd->plist, plugin); return R_TRUE; } @@ -28,11 +28,11 @@ R_API int r_cmd_handle_init(struct r_cmd_t *cmd) { R_API int r_cmd_handle_check(struct r_cmd_t *cmd, const char *a0) { RListIter *iter; - RCmdHandle *cp; + RCmdPlugin *cp; iter = r_list_iterator (cmd->plist); while (r_list_iter_next (iter)) { - cp = (RCmdHandle*) r_list_iter_get (iter); + cp = (RCmdPlugin*) r_list_iter_get (iter); if (cp->call (NULL, a0)) return R_TRUE; } diff --git a/libr/cmd/p/cmd_dummy.c b/libr/cmd/p/cmd_dummy.c index 83f9cc1b88..7ec09d1c10 100644 --- a/libr/cmd/p/cmd_dummy.c +++ b/libr/cmd/p/cmd_dummy.c @@ -11,7 +11,7 @@ static int call(void *user, const char *cmd) { return R_TRUE; } -struct r_cmd_handle_t r_cmd_plugin_dummy = { +struct r_cmd_plugin_t r_cmd_plugin_dummy = { .name = "dummy", .call = call, }; diff --git a/libr/cons/cons.c b/libr/cons/cons.c index ee2c1a5fd9..6f23fd2a22 100644 --- a/libr/cons/cons.c +++ b/libr/cons/cons.c @@ -61,10 +61,10 @@ R_API RCons *r_cons_new () { I.term_raw.c_cflag |= CS8; I.term_raw.c_cc[VMIN] = 1; // Solaris stuff hehe #elif __WINDOWS__ - h = GetStdHandle (STD_INPUT_HANDLE); + h = GetStdPlugin (STD_INPUT_HANDLE); GetConsoleMode (h, &I.term_buf); I.term_raw = 0; - if (!SetConsoleCtrlHandler ((PHANDLER_ROUTINE)__w32_control, TRUE)) + if (!SetConsoleCtrlPlugin ((PHANDLER_ROUTINE)__w32_control, TRUE)) eprintf ("r_cons: Cannot set control console handler\n"); #endif //r_cons_palette_init(NULL); @@ -108,7 +108,7 @@ R_API void r_cons_gotoxy(int x, int y) { coord.X = x; coord.Y = y; if (!hStdout) - hStdout = GetStdHandle (STD_OUTPUT_HANDLE); + hStdout = GetStdPlugin (STD_OUTPUT_HANDLE); SetConsoleCursorPosition (hStdout,coord); #else r_cons_printf ("\x1b[%d;%dH", y, x); @@ -128,7 +128,7 @@ R_API void r_cons_clear() { DWORD dummy; if (!hStdout) { - hStdout = GetStdHandle (STD_OUTPUT_HANDLE); + hStdout = GetStdPlugin (STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo (hStdout,&csbi); } diff --git a/libr/cons/input.c b/libr/cons/input.c index bca401f064..011c2764ad 100644 --- a/libr/cons/input.c +++ b/libr/cons/input.c @@ -52,7 +52,7 @@ R_API int r_cons_readchar() { BOOL ret; DWORD out; LPDWORD mode; - HANDLE h = GetStdHandle (STD_INPUT_HANDLE); + HANDLE h = GetStdPlugin (STD_INPUT_HANDLE); GetConsoleMode (h, &mode); SetConsoleMode (h, 0); // RAW ret = ReadConsole (h, buf,1, &out, NULL); diff --git a/libr/cons/output.c b/libr/cons/output.c index 7f99fc3a92..7d5066d1f7 100644 --- a/libr/cons/output.c +++ b/libr/cons/output.c @@ -5,7 +5,7 @@ #if __WINDOWS__ int r_cons_w32_print(ut8 *ptr) { - HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); + HANDLE hConsole = GetStdPlugin(STD_OUTPUT_HANDLE); int esc = 0; int bg = 0; ut8 *str = ptr; diff --git a/libr/core/cmd.c b/libr/core/cmd.c index 1a9c275348..9b0a3676d6 100644 --- a/libr/core/cmd.c +++ b/libr/core/cmd.c @@ -715,7 +715,7 @@ static int cmd_interpret(void *data, const char *input) { switch (input[0]) { case '\0': /* repeat last command */ - /* NOTE: Handled in r_core_cmd with ugly strcmp */ + /* NOTE: Plugind in r_core_cmd with ugly strcmp */ break; case ' ': if (!r_core_cmd_file (core, input+1)) diff --git a/libr/core/config.c b/libr/core/config.c index 230f19f5a3..b3f698f845 100644 --- a/libr/core/config.c +++ b/libr/core/config.c @@ -114,7 +114,7 @@ static int config_asm_bits_callback(void *user, void *data) { RConfigNode *node = (RConfigNode *) data; int ret = r_asm_set_bits (core->assembler, node->i_value); if (ret == R_FALSE) { - struct r_asm_handle_t *h = core->assembler->cur; + struct r_asm_plugin_t *h = core->assembler->cur; if (h) { eprintf ("Cannot set bits %"PFMT64d" to '%s'\n", node->i_value, h->name); diff --git a/libr/core/libs.c b/libr/core/libs.c index ee8aba68fd..dc4092cba6 100644 --- a/libr/core/libs.c +++ b/libr/core/libs.c @@ -4,7 +4,7 @@ /* io callback */ static int __lib_io_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_io_handle_t *hand = (struct r_io_handle_t *)data; + struct r_io_plugin_t *hand = (struct r_io_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added IO handler\n"); r_io_handle_add (core->io, hand); @@ -15,7 +15,7 @@ static int __lib_io_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_T /* cmd callback */ static int __lib_cmd_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_cmd_handle_t *hand = (struct r_cmd_handle_t *)data; + struct r_cmd_plugin_t *hand = (struct r_cmd_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added CMD handler\n"); r_cmd_handle_add (core->cmd, hand); @@ -26,7 +26,7 @@ static int __lib_cmd_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_ /* debug callback */ static int __lib_dbg_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_debug_handle_t *hand = (struct r_debug_handle_t *)data; + struct r_debug_plugin_t *hand = (struct r_debug_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added debugger handler\n"); r_debug_handle_add (core->dbg, hand); @@ -38,7 +38,7 @@ static int __lib_dbg_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_ /* breakpoint callback */ static int __lib_bp_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_bp_handle_t *hand = (struct r_bp_handle_t *)data; + struct r_bp_plugin_t *hand = (struct r_bp_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added bpger handler\n"); r_bp_handle_add (core->dbg->bp, hand); @@ -49,7 +49,7 @@ static int __lib_bp_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_T /* lang callback */ static int __lib_lng_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_lang_handle_t *hand = (struct r_lang_handle_t *)data; + struct r_lang_plugin_t *hand = (struct r_lang_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added language handler\n"); r_lang_add (core->lang, hand); @@ -60,7 +60,7 @@ static int __lib_lng_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_ /* anal callback */ static int __lib_anl_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_anal_handle_t *hand = (struct r_anal_handle_t *)data; + struct r_anal_plugin_t *hand = (struct r_anal_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added analysis handler\n"); r_anal_add (core->anal, hand); @@ -71,7 +71,7 @@ static int __lib_anl_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_ /* asm callback */ static int __lib_asm_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_asm_handle_t *hand = (struct r_asm_handle_t *)data; + struct r_asm_plugin_t *hand = (struct r_asm_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added (dis)assembly handler\n"); r_asm_add (core->assembler, hand); @@ -82,7 +82,7 @@ static int __lib_asm_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return R_ /* parse callback */ static int __lib_parse_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_parse_handle_t *hand = (struct r_parse_handle_t *)data; + struct r_parse_plugin_t *hand = (struct r_parse_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added (dis)assembly handler\n"); r_parse_add (core->parser, hand); @@ -93,7 +93,7 @@ static int __lib_parse_dt(struct r_lib_plugin_t *pl, void *p, void *u) { return /* bin callback */ static int __lib_bin_cb(struct r_lib_plugin_t *pl, void *user, void *data) { - struct r_bin_handle_t *hand = (struct r_bin_handle_t *)data; + struct r_bin_plugin_t *hand = (struct r_bin_plugin_t *)data; struct r_core_t *core = (struct r_core_t *)user; //printf(" * Added (dis)assembly handler\n"); r_bin_add (core->bin, hand); diff --git a/libr/crypto/crypto.c b/libr/crypto/crypto.c index 89c0723f51..df766a90d6 100644 --- a/libr/crypto/crypto.c +++ b/libr/crypto/crypto.c @@ -3,7 +3,7 @@ #include "r_crypto.h" #include "../config.h" -static struct r_crypto_handle_t *crypto_static_plugins[] = +static struct r_crypto_plugin_t *crypto_static_plugins[] = { R_CRYPTO_STATIC_PLUGINS }; R_API struct r_crypto_t *r_crypto_init(struct r_crypto_t *cry, int hard) @@ -25,14 +25,14 @@ R_API struct r_crypto_t *r_crypto_init(struct r_crypto_t *cry, int hard) return cry; } -R_API int r_crypto_add(struct r_crypto_t *cry, struct r_crypto_handle_t *h) +R_API int r_crypto_add(struct r_crypto_t *cry, struct r_crypto_plugin_t *h) { // add a check ? list_add_tail(&(h->list), &(cry->handlers)); return R_TRUE; } -R_API int r_crypto_del(struct r_crypto_t *cry, struct r_crypto_handle_t *h) +R_API int r_crypto_del(struct r_crypto_t *cry, struct r_crypto_plugin_t *h) { list_del(&(h->list)); return R_TRUE; @@ -70,7 +70,7 @@ R_API int r_crypto_use(struct r_crypto_t *cry, const char *algo) int ret = R_FALSE; struct list_head *pos; list_for_each_prev(pos, &cry->handlers) { - struct r_crypto_handle_t *h = list_entry(pos, struct r_crypto_handle_t, list); + struct r_crypto_plugin_t *h = list_entry(pos, struct r_crypto_plugin_t, list); if (h->use(algo)) { cry->h = h; cry->key_len = h->get_key_size(cry); diff --git a/libr/crypto/p/crypto_aes.c b/libr/crypto/p/crypto_aes.c index 5f7f55aa2c..6fa239efe7 100644 --- a/libr/crypto/p/crypto_aes.c +++ b/libr/crypto/p/crypto_aes.c @@ -1,7 +1,7 @@ #include #include -struct r_crypto_handle_t r_crypto_plugin_aes = { +struct r_crypto_plugin_t r_crypto_plugin_aes = { .name = "crypto_aes", /* TODO */ }; diff --git a/libr/debug/handle.c b/libr/debug/handle.c index f9c52203c4..db8651fa23 100644 --- a/libr/debug/handle.c +++ b/libr/debug/handle.c @@ -4,10 +4,10 @@ #include "../config.h" /* plugin pointers */ -extern RDebugHandle r_debug_plugin_native; -extern RDebugHandle r_debug_plugin_gdb; +extern RDebugPlugin r_debug_plugin_native; +extern RDebugPlugin r_debug_plugin_gdb; -static RDebugHandle *debug_static_plugins[] = +static RDebugPlugin *debug_static_plugins[] = { R_DEBUG_STATIC_PLUGINS }; R_API int r_debug_handle_init(RDebug *dbg) { @@ -22,7 +22,7 @@ R_API int r_debug_handle_init(RDebug *dbg) { R_API int r_debug_use(RDebug *dbg, const char *str) { struct list_head *pos; list_for_each_prev (pos, &dbg->handlers) { - RDebugHandle *h = list_entry (pos, RDebugHandle, list); + RDebugPlugin *h = list_entry (pos, RDebugPlugin, list); if (!strcmp (str, h->name)) { dbg->h = h; if (h->reg_profile) { @@ -40,14 +40,14 @@ R_API int r_debug_handle_list(RDebug *dbg) { int count = 0; struct list_head *pos; list_for_each_prev(pos, &dbg->handlers) { - RDebugHandle *h = list_entry(pos, RDebugHandle, list); + RDebugPlugin *h = list_entry(pos, RDebugPlugin, list); eprintf ("dbg %d %s %s\n", count, h->name, ((h==dbg->h)?"*":"")); count++; } return R_FALSE; } -R_API int r_debug_handle_add(RDebug *dbg, RDebugHandle *foo) { +R_API int r_debug_handle_add(RDebug *dbg, RDebugPlugin *foo) { list_add_tail(&(foo->list), &(dbg->handlers)); return R_TRUE; } diff --git a/libr/debug/p/debug_gdb.c b/libr/debug/p/debug_gdb.c index 4a1fe80618..fab38c8bcb 100644 --- a/libr/debug/p/debug_gdb.c +++ b/libr/debug/p/debug_gdb.c @@ -62,7 +62,7 @@ static int r_debug_gdb_detach(int pid) { return R_TRUE; } -struct r_debug_handle_t r_dbg_plugin_gdb = { +struct r_debug_plugin_t r_dbg_plugin_gdb = { .name = "gdb", .archs = { "x86", 0 }, //"x86-64", "arm", "powerpc", 0 }, .step = &r_debug_gdb_step, diff --git a/libr/debug/p/debug_native.c b/libr/debug/p/debug_native.c index 4177893444..95c0866e59 100644 --- a/libr/debug/p/debug_native.c +++ b/libr/debug/p/debug_native.c @@ -863,7 +863,7 @@ static RList *r_debug_native_frames(RDebug *dbg) { list->free = free; bio->read_at (bio->io, _rip, &buf, 4); /* %rbp=old rbp, %rbp+4 points to ret */ - /* Handle before function prelude: push %rbp ; mov %rsp, %rbp */ + /* Plugin before function prelude: push %rbp ; mov %rsp, %rbp */ if (!memcmp (buf, "\x55\x89\xe5", 3) || !memcmp (buf, "\x89\xe5\x57", 3)) { if (bio->read_at (bio->io, _rsp, &ptr, 4) != 4) { eprintf ("read error at 0x%08"PFMT64x"\n", _rsp); @@ -923,7 +923,7 @@ static int r_debug_native_init(RDebug *dbg) { #endif } -struct r_debug_handle_t r_debug_plugin_native = { +struct r_debug_plugin_t r_debug_plugin_native = { .name = "native", #if __i386__ .bits = R_SYS_BITS_32, @@ -971,7 +971,7 @@ struct r_lib_struct_t radare_plugin = { //#endif #else // DEBUGGER -struct r_debug_handle_t r_debug_plugin_native = { +struct r_debug_plugin_t r_debug_plugin_native = { .name = "native", }; diff --git a/libr/debug/p/native/w32.c b/libr/debug/p/native/w32.c index 95f270d462..d5694f6c9d 100644 --- a/libr/debug/p/native/w32.c +++ b/libr/debug/p/native/w32.c @@ -90,19 +90,19 @@ static int w32_dbg_init() { HANDLE lib; w32_detach = (BOOL WINAPI (*)(DWORD)) - GetProcAddress (GetModuleHandle ("kernel32"), + GetProcAddress (GetModulePlugin ("kernel32"), "DebugActiveProcessStop"); w32_openthread = (HANDLE WINAPI (*)(DWORD, BOOL, DWORD)) - GetProcAddress (GetModuleHandle ("kernel32"), "OpenThread"); + GetProcAddress (GetModulePlugin ("kernel32"), "OpenThread"); w32_dbgbreak = (HANDLE WINAPI (*)(HANDLE)) - GetProcAddress (GetModuleHandle ("kernel32"), + GetProcAddress (GetModulePlugin ("kernel32"), "DebugBreakProcess"); // only windows vista :( w32_getthreadid = (DWORD WINAPI (*)(HANDLE)) - GetProcAddress (GetModuleHandle ("kernel32"), "GetThreadId"); + GetProcAddress (GetModulePlugin ("kernel32"), "GetThreadId"); // from xp1 w32_getprocessid = (DWORD WINAPI (*)(HANDLE)) - GetProcAddress (GetModuleHandle ("kernel32"), "GetProcessId"); + GetProcAddress (GetModulePlugin ("kernel32"), "GetProcessId"); lib = LoadLibrary ("psapi.dll"); if(lib == NULL) { @@ -194,7 +194,7 @@ err_load_th: //print_lasterr((char *)__FUNCTION__); if (th != INVALID_HANDLE_VALUE) - CloseHandle (th); + ClosePlugin (th); return ret; #endif return 0; diff --git a/libr/include/r_anal.h b/libr/include/r_anal.h index 120cee5725..73afc825ab 100644 --- a/libr/include/r_anal.h +++ b/libr/include/r_anal.h @@ -126,7 +126,7 @@ typedef struct r_anal_t { RList *fcns; RList *vartypes; struct r_anal_ctx_t *ctx; - struct r_anal_handle_t *cur; + struct r_anal_plugin_t *cur; struct list_head anals; } RAnal; @@ -203,7 +203,7 @@ typedef struct r_anal_refline_t { } RAnalRefline; //TODO: typedef RAnalOpCallback -typedef struct r_anal_handle_t { +typedef struct r_anal_plugin_t { char *name; char *desc; int (*init)(void *user); @@ -212,14 +212,14 @@ typedef struct r_anal_handle_t { int (*aop)(RAnal *a, struct r_anal_aop_t *aop, ut64 addr, const ut8 *data, int len); struct list_head list; -} RAnalHandle; +} RAnalPlugin; #ifdef R_API /* anal.c */ R_API RAnal *r_anal_new(); R_API RAnal *r_anal_free(RAnal *r); R_API void r_anal_set_user_ptr(RAnal *anal, void *user); -R_API int r_anal_add(RAnal *anal, struct r_anal_handle_t *foo); +R_API int r_anal_add(RAnal *anal, struct r_anal_plugin_t *foo); R_API int r_anal_list(RAnal *anal); R_API int r_anal_use(RAnal *anal, const char *name); R_API int r_anal_set_bits(RAnal *anal, int bits); @@ -291,12 +291,12 @@ R_API char* r_anal_reflines_str(struct r_anal_t *anal, struct r_anal_refline_t * R_API int r_anal_reflines_middle(RAnal *anal, RAnalRefline *list, ut64 addr, int len); /* plugin pointers */ -extern RAnalHandle r_anal_plugin_csr; -extern RAnalHandle r_anal_plugin_arm; -extern RAnalHandle r_anal_plugin_x86; -extern RAnalHandle r_anal_plugin_x86_x86im; -extern RAnalHandle r_anal_plugin_ppc; -extern RAnalHandle r_anal_plugin_java; +extern RAnalPlugin r_anal_plugin_csr; +extern RAnalPlugin r_anal_plugin_arm; +extern RAnalPlugin r_anal_plugin_x86; +extern RAnalPlugin r_anal_plugin_x86_x86im; +extern RAnalPlugin r_anal_plugin_ppc; +extern RAnalPlugin r_anal_plugin_java; #endif #endif diff --git a/libr/include/r_asm.h b/libr/include/r_asm.h index b1684ce4e5..d9b46519f9 100644 --- a/libr/include/r_asm.h +++ b/libr/include/r_asm.h @@ -71,7 +71,7 @@ typedef struct r_asm_t { int syntax; ut64 pc; void *user; - struct r_asm_handler_t *cur; + struct r_asm_plugin_t *cur; RAsmFastcall *fastcall; RList *handlers; } RAsm; @@ -79,7 +79,7 @@ typedef struct r_asm_t { typedef int (*RAsmModifyCallback)(RAsm *a, ut8 *buf, int field, ut64 val); // TODO: rename to handler? -typedef struct r_asm_handler_t { +typedef struct r_asm_plugin_t { char *name; char *arch; char *desc; @@ -93,7 +93,7 @@ typedef struct r_asm_handler_t { RAsmModifyCallback modify; int (*set_subarch)(RAsm *a, const char *buf); struct r_asm_fastcall_t *fastcall[R_ASM_FASTCALL_ARGS]; -} RAsmHandler; +} RAsmPlugin; #ifdef R_API /* asm.c */ @@ -104,7 +104,7 @@ R_API void r_asm_free(RAsm *a); R_API void* r_asm_code_free(struct r_asm_code_t *acode); R_API int r_asm_modify(RAsm *a, ut8 *buf, int field, ut64 val); R_API void r_asm_set_user_ptr(RAsm *a, void *user); -R_API int r_asm_add(RAsm *a, RAsmHandler *foo); +R_API int r_asm_add(RAsm *a, RAsmPlugin *foo); R_API int r_asm_use(RAsm *a, const char *name); R_API int r_asm_set_bits(RAsm *a, int bits); R_API int r_asm_set_big_endian(RAsm *a, int boolean); @@ -122,20 +122,20 @@ R_API int r_asm_code_set_equ (RAsmCode *code, const char *key, const char *value R_API char *r_asm_code_equ_replace (RAsmCode *code, char *str); /* plugin pointers */ -extern RAsmHandler r_asm_plugin_dummy; -extern RAsmHandler r_asm_plugin_bf; -extern RAsmHandler r_asm_plugin_java; -extern RAsmHandler r_asm_plugin_mips; -extern RAsmHandler r_asm_plugin_x86; -extern RAsmHandler r_asm_plugin_x86_olly; -extern RAsmHandler r_asm_plugin_x86_nasm; -extern RAsmHandler r_asm_plugin_arm; -extern RAsmHandler r_asm_plugin_csr; -extern RAsmHandler r_asm_plugin_m68k; -extern RAsmHandler r_asm_plugin_ppc; -extern RAsmHandler r_asm_plugin_sparc; -extern RAsmHandler r_asm_plugin_psosvm; -extern RAsmHandler r_asm_plugin_avr; +extern RAsmPlugin r_asm_plugin_dummy; +extern RAsmPlugin r_asm_plugin_bf; +extern RAsmPlugin r_asm_plugin_java; +extern RAsmPlugin r_asm_plugin_mips; +extern RAsmPlugin r_asm_plugin_x86; +extern RAsmPlugin r_asm_plugin_x86_olly; +extern RAsmPlugin r_asm_plugin_x86_nasm; +extern RAsmPlugin r_asm_plugin_arm; +extern RAsmPlugin r_asm_plugin_csr; +extern RAsmPlugin r_asm_plugin_m68k; +extern RAsmPlugin r_asm_plugin_ppc; +extern RAsmPlugin r_asm_plugin_sparc; +extern RAsmPlugin r_asm_plugin_psosvm; +extern RAsmPlugin r_asm_plugin_avr; #endif #endif diff --git a/libr/include/r_bin.h b/libr/include/r_bin.h index 41ca0780b8..1e8bba8d85 100644 --- a/libr/include/r_bin.h +++ b/libr/include/r_bin.h @@ -36,11 +36,11 @@ typedef struct r_bin_t { RList* libs; RBuffer *buf; void *user; - struct r_bin_handle_t *cur; + struct r_bin_plugin_t *cur; struct list_head bins; } RBin; -typedef struct r_bin_handle_t { +typedef struct r_bin_plugin_t { char *name; char *desc; int (*init)(void *user); @@ -60,7 +60,7 @@ typedef struct r_bin_handle_t { struct r_bin_meta_t *meta; struct r_bin_write_t *write; struct list_head list; -} RBinHandle; +} RBinPlugin; typedef struct r_bin_entry_t { ut64 rva; @@ -138,7 +138,7 @@ typedef struct r_bin_write_t { #ifdef R_API /* bin.c */ -R_API int r_bin_add(RBin *bin, RBinHandle *foo); +R_API int r_bin_add(RBin *bin, RBinPlugin *foo); R_API void* r_bin_free(RBin *bin); R_API int r_bin_list(RBin *bin); R_API int r_bin_load(RBin *bin, const char *file, const char *plugin_name); diff --git a/libr/include/r_bp.h b/libr/include/r_bp.h index 194de5616d..2242c06613 100644 --- a/libr/include/r_bp.h +++ b/libr/include/r_bp.h @@ -24,14 +24,14 @@ enum { R_BP_TYPE_DELETE, }; -typedef struct r_bp_handle_t { +typedef struct r_bp_plugin_t { char *name; char *arch; int type; // R_BP_TYPE_SW int nbps; struct r_bp_arch_t *bps; struct list_head list; -} RBreakpointHandler; +} RBreakpointPlugin; typedef struct r_bp_item_t { ut64 addr; @@ -59,7 +59,7 @@ typedef struct r_bp_t { RList *traces; RBreakpointCallback breakpoint; struct r_io_bind_t iob; // compile time dependency - struct r_bp_handle_t *cur; + struct r_bp_plugin_t *cur; struct list_head plugins; struct list_head bps; } RBreakpoint; @@ -87,7 +87,7 @@ R_API RBreakpoint *r_bp_free(RBreakpoint *bp); R_API int r_bp_del(RBreakpoint *bp, ut64 addr); -R_API int r_bp_handle_add(RBreakpoint *bp, struct r_bp_handle_t *foo); +R_API int r_bp_handle_add(RBreakpoint *bp, struct r_bp_plugin_t *foo); R_API int r_bp_use(RBreakpoint *bp, const char *name); R_API int r_bp_handle_del(RBreakpoint *bp, const char *name); R_API void r_bp_handle_list(RBreakpoint *bp); @@ -123,12 +123,12 @@ R_API void r_bp_traptrace_enable(RBreakpoint *bp, int enable); #endif /* plugin pointers */ -extern struct r_bp_handle_t r_bp_plugin_x86; -extern struct r_bp_handle_t r_bp_plugin_arm; +extern struct r_bp_plugin_t r_bp_plugin_x86; +extern struct r_bp_plugin_t r_bp_plugin_arm; #if 0 -extern struct r_bp_handle_t r_bp_plugin_powerpc; -extern struct r_bp_handle_t r_bp_plugin_mips; -extern struct r_bp_handle_t r_bp_plugin_sparc; +extern struct r_bp_plugin_t r_bp_plugin_powerpc; +extern struct r_bp_plugin_t r_bp_plugin_mips; +extern struct r_bp_plugin_t r_bp_plugin_sparc; #endif #endif diff --git a/libr/include/r_cmd.h b/libr/include/r_cmd.h index 1b30b78363..bda48ceb09 100644 --- a/libr/include/r_cmd.h +++ b/libr/include/r_cmd.h @@ -63,10 +63,10 @@ typedef struct r_cmd_t { RList *plist; } RCmd; -typedef struct r_cmd_handle_t { +typedef struct r_cmd_plugin_t { char *name; RCmdCallback call; -} RCmdHandle; +} RCmdPlugin; #ifdef R_API @@ -88,11 +88,11 @@ R_API int r_cmd_call_long(struct r_cmd_t *cmd, const char *input); R_API char **r_cmd_args(struct r_cmd_t *cmd, int *argc); R_API int r_cmd_handle_init(struct r_cmd_t *cmd); -R_API int r_cmd_handle_add(struct r_cmd_t *cmd, struct r_cmd_handle_t *plugin); +R_API int r_cmd_handle_add(struct r_cmd_t *cmd, struct r_cmd_plugin_t *plugin); R_API int r_cmd_handle_check(struct r_cmd_t *cmd, const char *a0); /* plugins */ -extern struct r_cmd_handle_t r_cmd_plugin_dummy; +extern struct r_cmd_plugin_t r_cmd_plugin_dummy; /* r_cmd_macro */ R_API void r_cmd_macro_init(struct r_cmd_macro_t *mac); diff --git a/libr/include/r_crypto.h b/libr/include/r_crypto.h index 99c99c3d31..ffb4264f5a 100644 --- a/libr/include/r_crypto.h +++ b/libr/include/r_crypto.h @@ -17,7 +17,7 @@ enum { }; typedef struct r_crypto_t { - struct r_crypto_handle_t* h; + struct r_crypto_plugin_t* h; ut8 *key; ut8 *iv; int key_len; @@ -28,7 +28,7 @@ typedef struct r_crypto_t { struct list_head handlers; } RCrypto; -typedef struct r_crypto_handle_t { +typedef struct r_crypto_plugin_t { const char *name; int (*get_key_size)(struct r_crypto_t* cry); int (*set_iv)(struct r_crypto_t* cry, const ut8 *iv); @@ -38,12 +38,12 @@ typedef struct r_crypto_handle_t { int (*use)(const char *algo); int (*fini)(struct r_crypto_t *cry); struct list_head list; -} RCryptoHandle; +} RCryptoPlugin; #ifdef R_API R_API struct r_crypto_t *r_crypto_init(struct r_crypto_t *cry, int hard); R_API struct r_crypto_t *r_crypto_as_new(struct r_crypto_t *cry); -R_API int r_crypto_add(struct r_crypto_t *cry, struct r_crypto_handle_t *h); +R_API int r_crypto_add(struct r_crypto_t *cry, struct r_crypto_plugin_t *h); R_API struct r_crypto_t *r_crypto_new(); R_API struct r_crypto_t *r_crypto_free(struct r_crypto_t *cry); R_API int r_crypto_use(struct r_crypto_t *cry, const char *algo); @@ -57,6 +57,6 @@ R_API ut8 *r_crypto_get_output(struct r_crypto_t *cry); #endif /* plugin pointers */ -extern struct r_crypto_handle_t r_crypto_plugin_aes; +extern struct r_crypto_plugin_t r_crypto_plugin_aes; #endif diff --git a/libr/include/r_debug.h b/libr/include/r_debug.h index 13aa9ffd87..afbd93d544 100644 --- a/libr/include/r_debug.h +++ b/libr/include/r_debug.h @@ -67,7 +67,7 @@ typedef struct r_debug_t { void *user; /* io */ void (*printf)(const char *str, ...); - struct r_debug_handle_t *h; + struct r_debug_plugin_t *h; struct list_head handlers; RAnal *anal; RIOBind iob; @@ -81,7 +81,7 @@ typedef struct r_debug_t { } RDebug; /* TODO: pass dbg and user data pointer everywhere */ -typedef struct r_debug_handle_t { +typedef struct r_debug_plugin_t { const char *name; const char **archs; // MUST BE DEPREACTED!!!! ut32 bits; @@ -112,7 +112,7 @@ typedef struct r_debug_handle_t { int (*map_dealloc)(RDebug *dbg, ut64 addr); int (*init)(RDebug *dbg); struct list_head list; -} RDebugHandle; +} RDebugPlugin; // TODO: rename to r_debug_process_t ? maybe a thread too ? typedef struct r_debug_pid_t { @@ -146,7 +146,7 @@ R_API int r_debug_pid_list(struct r_debug_t *dbg, int pid); R_API RDebugPid *r_debug_pid_new(char *path, int pid, char status); R_API int r_debug_use(struct r_debug_t *dbg, const char *str); -R_API int r_debug_handle_add(struct r_debug_t *dbg, struct r_debug_handle_t *foo); +R_API int r_debug_handle_add(struct r_debug_t *dbg, struct r_debug_plugin_t *foo); R_API int r_debug_handle_init(struct r_debug_t *dbg); R_API int r_debug_handle_list(struct r_debug_t *dbg); @@ -165,7 +165,7 @@ R_API int r_debug_select(struct r_debug_t *dbg, int pid, int tid); R_API int r_debug_handle_init(struct r_debug_t *dbg); R_API int r_debug_handle_set(struct r_debug_t *dbg, const char *str); R_API int r_debug_handle_list(struct r_debug_t *dbg); -R_API int r_debug_handle_add(struct r_debug_t *dbg, struct r_debug_handle_t *foo); +R_API int r_debug_handle_add(struct r_debug_t *dbg, struct r_debug_plugin_t *foo); /* memory */ R_API int r_debug_map_alloc(RDebug *dbg, RDebugMap *map); diff --git a/libr/include/r_io.h b/libr/include/r_io.h index 61a36fa3a2..f52a08438a 100644 --- a/libr/include/r_io.h +++ b/libr/include/r_io.h @@ -63,7 +63,7 @@ typedef struct r_io_t { int write_mask_fd; ut8 *write_mask_buf; int write_mask_len; - struct r_io_handle_t *plugin; + struct r_io_plugin_t *plugin; struct r_io_undo_t undo; struct list_head io_list; struct list_head sections; @@ -77,7 +77,7 @@ typedef struct r_io_t { // ... store io changes here //}; -typedef struct r_io_handle_t { +typedef struct r_io_plugin_t { void *handle; char *name; char *desc; @@ -95,10 +95,10 @@ typedef struct r_io_handle_t { int (*handle_open)(RIO *io, const char *); //int (*handle_fd)(RIO *, int); int fds[R_IO_NFDS]; -} RIOHandle; +} RIOPlugin; typedef struct r_io_list_t { - struct r_io_handle_t *plugin; + struct r_io_plugin_t *plugin; struct list_head list; } RIOList; @@ -139,7 +139,7 @@ typedef struct r_io_desc_t { int fd; int flags; char name[4096]; - struct r_io_handle_t *handle; + struct r_io_plugin_t *handle; struct list_head list; } RIODesc; @@ -150,14 +150,14 @@ typedef struct r_io_desc_t { R_API RIO *r_io_new(); R_API RIO *r_io_free(RIO *io); R_API int r_io_handle_init(RIO *io); -R_API int r_io_handle_open(RIO *io, int fd, struct r_io_handle_t *plugin); -R_API int r_io_handle_close(RIO *io, int fd, struct r_io_handle_t *plugin); +R_API int r_io_handle_open(RIO *io, int fd, struct r_io_plugin_t *plugin); +R_API int r_io_handle_close(RIO *io, int fd, struct r_io_plugin_t *plugin); R_API int r_io_handle_generate(RIO *io); -R_API int r_io_handle_add(RIO *io, struct r_io_handle_t *plugin); +R_API int r_io_handle_add(RIO *io, struct r_io_plugin_t *plugin); R_API int r_io_handle_list(RIO *io); // TODO: _del ?? -R_API struct r_io_handle_t *r_io_handle_resolve(RIO *io, const char *filename); -R_API struct r_io_handle_t *r_io_handle_resolve_fd(RIO *io, int fd); +R_API struct r_io_plugin_t *r_io_handle_resolve(RIO *io, const char *filename); +R_API struct r_io_plugin_t *r_io_handle_resolve_fd(RIO *io, int fd); /* io/io.c */ R_API int r_io_set_write_mask(RIO *io, const ut8 *buf, int len); @@ -237,20 +237,20 @@ R_API int r_io_wundo_set(RIO *io, int n, int set); /* io/desc.c */ R_API int r_io_desc_init(RIO *io); -R_API int r_io_desc_add(RIO *io, int fd, const char *file, int flags, struct r_io_handle_t *handle); +R_API int r_io_desc_add(RIO *io, int fd, const char *file, int flags, struct r_io_plugin_t *handle); R_API int r_io_desc_del(RIO *io, int fd); R_API struct r_io_desc_t *r_io_desc_get(RIO *io, int fd); R_API int r_io_desc_generate(RIO *io); /* plugins */ -extern struct r_io_handle_t r_io_plugin_procpid; -extern struct r_io_handle_t r_io_plugin_malloc; -extern struct r_io_handle_t r_io_plugin_ptrace; -extern struct r_io_handle_t r_io_plugin_w32dbg; -extern struct r_io_handle_t r_io_plugin_mach; -extern struct r_io_handle_t r_io_plugin_debug; -extern struct r_io_handle_t r_io_plugin_shm; +extern struct r_io_plugin_t r_io_plugin_procpid; +extern struct r_io_plugin_t r_io_plugin_malloc; +extern struct r_io_plugin_t r_io_plugin_ptrace; +extern struct r_io_plugin_t r_io_plugin_w32dbg; +extern struct r_io_plugin_t r_io_plugin_mach; +extern struct r_io_plugin_t r_io_plugin_debug; +extern struct r_io_plugin_t r_io_plugin_shm; #endif #if 0 diff --git a/libr/include/r_lang.h b/libr/include/r_lang.h index f7f6d827ab..50f9c7b0de 100644 --- a/libr/include/r_lang.h +++ b/libr/include/r_lang.h @@ -5,13 +5,13 @@ #include typedef struct r_lang_t { - struct r_lang_handle_t *cur; + struct r_lang_plugin_t *cur; void *user; struct list_head defs; struct list_head langs; } RLang; -typedef struct r_lang_handle_t { +typedef struct r_lang_plugin_t { const char *name; const char *desc; const char **help; @@ -23,7 +23,7 @@ typedef struct r_lang_handle_t { int (*run_file)(struct r_lang_t *user, const char *file); int (*set_argv)(struct r_lang_t *user, int argc, char **argv); struct list_head list; -} RLangHandle; +} RLangPlugin; typedef struct r_lang_def_t { char *name; @@ -36,7 +36,7 @@ typedef struct r_lang_def_t { R_API struct r_lang_t *r_lang_new(); R_API void *r_lang_free(struct r_lang_t *lang); R_API int r_lang_setup(RLang *lang); -R_API int r_lang_add(struct r_lang_t *lang, struct r_lang_handle_t *foo); +R_API int r_lang_add(struct r_lang_t *lang, struct r_lang_plugin_t *foo); R_API int r_lang_list(struct r_lang_t *lang); R_API int r_lang_use(struct r_lang_t *lang, const char *name); R_API int r_lang_run(struct r_lang_t *lang, const char *code, int len); diff --git a/libr/include/r_parse.h b/libr/include/r_parse.h index 7b54328b3b..6a91c41ace 100644 --- a/libr/include/r_parse.h +++ b/libr/include/r_parse.h @@ -12,11 +12,11 @@ typedef struct r_parse_t { void *user; - struct r_parse_handle_t *cur; + struct r_parse_plugin_t *cur; struct list_head parsers; } RParse; -typedef struct r_parse_handle_t { +typedef struct r_parse_plugin_t { char *name; char *desc; int (*init)(void *user); @@ -25,13 +25,13 @@ typedef struct r_parse_handle_t { int (*assemble)(struct r_parse_t *p, char *data, char *str); int (*filter)(struct r_parse_t *p, struct r_flag_t *f, char *data, char *str); struct list_head list; -} RParseHandle; +} RParsePlugin; /* parse.c */ R_API struct r_parse_t *r_parse_new(); R_API void r_parse_free(struct r_parse_t *p); R_API void r_parse_set_user_ptr(struct r_parse_t *p, void *user); -R_API int r_parse_add(struct r_parse_t *p, struct r_parse_handle_t *foo); +R_API int r_parse_add(struct r_parse_t *p, struct r_parse_plugin_t *foo); R_API int r_parse_list(struct r_parse_t *p); R_API int r_parse_use(struct r_parse_t *p, const char *name); R_API int r_parse_parse(struct r_parse_t *p, void *data, char *str); @@ -39,8 +39,8 @@ R_API int r_parse_assemble(struct r_parse_t *p, char *data, char *str); R_API int r_parse_filter(struct r_parse_t *p, struct r_flag_t *f, char *data, char *str); /* plugin pointers */ -extern struct r_parse_handle_t r_parse_plugin_dummy; -extern struct r_parse_handle_t r_parse_plugin_x86_pseudo; -extern struct r_parse_handle_t r_parse_plugin_mreplace; +extern struct r_parse_plugin_t r_parse_plugin_dummy; +extern struct r_parse_plugin_t r_parse_plugin_x86_pseudo; +extern struct r_parse_plugin_t r_parse_plugin_mreplace; #endif diff --git a/libr/include/r_syscall.h b/libr/include/r_syscall.h index a562f01f0c..43a50cac7e 100644 --- a/libr/include/r_syscall.h +++ b/libr/include/r_syscall.h @@ -20,7 +20,7 @@ typedef struct r_syscall_t { } RSyscall; /* plugin struct */ -typedef struct r_syscall_handle_t { +typedef struct r_syscall_plugin_t { char *name; char *arch; char *os; @@ -29,9 +29,9 @@ typedef struct r_syscall_handle_t { int nargs; struct r_syscall_args_t *args; struct list_head list; -} RSyscallHandle; +} RSyscallPlugin; -typedef struct r_syscall_arch_handle_t { +typedef struct r_syscall_arch_plugin_t { char *name; char *arch; char *desc; @@ -39,7 +39,7 @@ typedef struct r_syscall_arch_handle_t { int nargs; struct r_syscall_args_t **args; struct list_head list; -} RSyscallArchHandle; +} RSyscallArchPlugin; #ifdef R_API R_API RSyscall *r_syscall_new(); diff --git a/libr/io/README b/libr/io/README index 612b171daa..ea9fc2e5ef 100644 --- a/libr/io/README +++ b/libr/io/README @@ -21,6 +21,6 @@ NOTES: each plugin handle must provide a 'optimal' read size.. or io must be con var io = new Radare.Io(); int fd = io.open("/bin/ls"); -foreach (Io.Handle handle in io.handle_list()) { +foreach (Io.Plugin handle in io.handle_list()) { stdout.printf(" %s\n", handle.name); } diff --git a/libr/io/desc.c b/libr/io/desc.c index 3ecbb83833..19afe5a0d4 100644 --- a/libr/io/desc.c +++ b/libr/io/desc.c @@ -7,7 +7,7 @@ R_API int r_io_desc_init(struct r_io_t *io) { return R_TRUE; } -R_API int r_io_desc_add(struct r_io_t *io, int fd, const char *file, int flags, struct r_io_handle_t *handle) { +R_API int r_io_desc_add(struct r_io_t *io, int fd, const char *file, int flags, struct r_io_plugin_t *handle) { RIODesc *desc = R_NEW (RIODesc); if (desc == NULL) return R_FALSE; diff --git a/libr/io/handle.c b/libr/io/handle.c index 27a231581a..abc699ec5d 100644 --- a/libr/io/handle.c +++ b/libr/io/handle.c @@ -7,10 +7,10 @@ #include "list.h" #include -static struct r_io_handle_t *io_static_plugins[] = +static struct r_io_plugin_t *io_static_plugins[] = { R_IO_STATIC_PLUGINS }; -R_API int r_io_handle_add(struct r_io_t *io, struct r_io_handle_t *plugin) { +R_API int r_io_handle_add(struct r_io_t *io, struct r_io_plugin_t *plugin) { int i; struct r_io_list_t *li; if (plugin == NULL) @@ -33,7 +33,7 @@ R_API int r_io_handle_init(struct r_io_t *io) { return R_TRUE; } -R_API struct r_io_handle_t *r_io_handle_resolve(struct r_io_t *io, const char *filename) { +R_API struct r_io_plugin_t *r_io_handle_resolve(struct r_io_t *io, const char *filename) { struct list_head *pos; list_for_each_prev(pos, &io->io_list) { struct r_io_list_t *il = list_entry(pos, struct r_io_list_t, list); @@ -47,7 +47,7 @@ R_API struct r_io_handle_t *r_io_handle_resolve(struct r_io_t *io, const char *f return NULL; } -R_API struct r_io_handle_t *r_io_handle_resolve_fd(struct r_io_t *io, int fd) { +R_API struct r_io_plugin_t *r_io_handle_resolve_fd(struct r_io_t *io, int fd) { int i; struct list_head *pos; list_for_each_prev(pos, &io->io_list) { @@ -60,7 +60,7 @@ R_API struct r_io_handle_t *r_io_handle_resolve_fd(struct r_io_t *io, int fd) { return NULL; } -R_API int r_io_handle_open(struct r_io_t *io, int fd, struct r_io_handle_t *plugin) { +R_API int r_io_handle_open(struct r_io_t *io, int fd, struct r_io_plugin_t *plugin) { int i=0; struct list_head *pos; list_for_each_prev(pos, &io->io_list) { @@ -78,7 +78,7 @@ R_API int r_io_handle_open(struct r_io_t *io, int fd, struct r_io_handle_t *plug return -1; } -R_API int r_io_handle_close(struct r_io_t *io, int fd, struct r_io_handle_t *plugin) { +R_API int r_io_handle_close(struct r_io_t *io, int fd, struct r_io_plugin_t *plugin) { int i=0; struct list_head *pos; list_for_each_prev(pos, &io->io_list) { diff --git a/libr/io/io.c b/libr/io/io.c index db04c08f7f..c37b407ddb 100644 --- a/libr/io/io.c +++ b/libr/io/io.c @@ -70,7 +70,7 @@ R_API int r_io_open_as(struct r_io_t *io, const char *urihandler, const char *fi R_API int r_io_open(struct r_io_t *io, const char *file, int flags, int mode) { int fd = -2; char *uri = strdup (file); - struct r_io_handle_t *plugin; + struct r_io_plugin_t *plugin; if (io != NULL) { for (;;) { plugin = r_io_handle_resolve (io, uri); @@ -179,7 +179,7 @@ R_API int r_io_resize(struct r_io_t *io, const char *file, int flags, int mode) // XXX not implemented #if 0 /* TODO */ - struct r_io_handle_t *plugin = r_io_handle_resolve(file); + struct r_io_plugin_t *plugin = r_io_handle_resolve(file); if (plugin && io->plugin->resize) { int fd = plugin->resize(file, flags, mode); if (fd != -1) diff --git a/libr/io/p/io_debug.c b/libr/io/p/io_debug.c index 25c2e3cc38..1bfbeb50e2 100644 --- a/libr/io/p/io_debug.c +++ b/libr/io/p/io_debug.c @@ -70,7 +70,7 @@ static int setup_tokens() { err = 0; err_enable: if (tok != NULL) - CloseHandle (tok); + ClosePlugin (tok); if (err) r_sys_perror ("setup_tokens"); return err; @@ -102,7 +102,7 @@ static int fork_and_ptraceme(const char *cmd) { THREADENTRY32 te32; HANDLE WINAPI (*win32_openthread)(DWORD, BOOL, DWORD) = NULL; win32_openthread = (HANDLE WINAPI (*)(DWORD, BOOL, DWORD)) - GetProcAddress (GetModuleHandle ("kernel32"), "OpenThread"); + GetProcAddress (GetModulePlugin ("kernel32"), "OpenThread"); th = CreateToolhelp32Snapshot (TH32CS_SNAPTHREAD, pid); if (th == INVALID_HANDLE_VALUE || !Thread32First(th, &te32)) { @@ -140,7 +140,7 @@ static int fork_and_ptraceme(const char *cmd) { } if (th != INVALID_HANDLE_VALUE) - CloseHandle (th); + ClosePlugin (th); eprintf ("PID=%d\n", pid); @@ -150,7 +150,7 @@ static int fork_and_ptraceme(const char *cmd) { err_fork: TerminateProcess (pi.hProcess, 1); if (th != INVALID_HANDLE_VALUE) - CloseHandle (th); + ClosePlugin (th); return -1; } #else @@ -251,7 +251,7 @@ static int __init(struct r_io_t *io) { return R_TRUE; } -struct r_io_handle_t r_io_plugin_debug = { +struct r_io_plugin_t r_io_plugin_debug = { //void *handle; .name = "debug", .desc = "Debug a program or pid. dbg:///bin/ls, dbg://1388", @@ -269,7 +269,7 @@ struct r_io_handle_t r_io_plugin_debug = { */ }; #else // DEBUGGER -struct r_io_handle_t r_io_plugin_debug = { +struct r_io_plugin_t r_io_plugin_debug = { .name = "debug", .desc = "Debug a program or pid. (NOT SUPPORTED FOR THIS PLATFORM)", .debug = (void *)1, diff --git a/libr/io/p/io_ewf.c b/libr/io/p/io_ewf.c index 19f2867b97..ae012641c4 100644 --- a/libr/io/p/io_ewf.c +++ b/libr/io/p/io_ewf.c @@ -123,7 +123,7 @@ static int ewf__open(struct r_io_t *io, const char *pathname, int flags, int mod else { ewf_fd = EWF_FD; #if 0 - if( ((libewf_internal_handle_t*)ewf_h)->header_values == NULL ) { + if( ((libewf_internal_plugin_t*)ewf_h)->header_values == NULL ) { fprintf( stream, "\tNo information found in file.\n" ); } else { libewf_get_header_value_examiner_name(ewf_h, hash, 128); @@ -163,7 +163,7 @@ static int ewf__init(struct r_io_t *io) { return R_TRUE; } -struct r_io_handle_t r_io_plugin_ewf = { +struct r_io_plugin_t r_io_plugin_ewf = { //void *handle; .name = "ewf", .desc = "Forensic file formats (Encase, ..) (ewf://file, els://file)", diff --git a/libr/io/p/io_mach.c b/libr/io/p/io_mach.c index 11819307ac..fd36cba974 100644 --- a/libr/io/p/io_mach.c +++ b/libr/io/p/io_mach.c @@ -207,7 +207,7 @@ static int __init(struct r_io_t *io) { } // TODO: rename ptrace to io_mach .. err io.ptrace ?? -struct r_io_handle_t r_io_plugin_mach = { +struct r_io_plugin_t r_io_plugin_mach = { //void *handle; .name = "mach", .desc = "mach debug io", @@ -224,7 +224,7 @@ struct r_io_handle_t r_io_plugin_mach = { #else -struct r_io_handle_t r_io_plugin_mach = { +struct r_io_plugin_t r_io_plugin_mach = { .name = "io.ptrace", .desc = "ptrace io (NOT SUPPORTED FOR THIS PLATFORM)", }; diff --git a/libr/io/p/io_malloc.c b/libr/io/p/io_malloc.c index 2cd95b532a..1412581e0d 100644 --- a/libr/io/p/io_malloc.c +++ b/libr/io/p/io_malloc.c @@ -102,7 +102,7 @@ static int __system(struct r_io_t *io, int fd, const char *cmd) return 0; } -struct r_io_handle_t r_io_plugin_malloc = { +struct r_io_plugin_t r_io_plugin_malloc = { //void *handle; .name = "malloc", .desc = "memory allocation ( malloc://size-in-bytes )", diff --git a/libr/io/p/io_procpid.c b/libr/io/p/io_procpid.c index 0198415935..3a66768e36 100644 --- a/libr/io/p/io_procpid.c +++ b/libr/io/p/io_procpid.c @@ -112,7 +112,7 @@ static int __init(struct r_io_t *io) { } // TODO: rename ptrace to io_ptrace .. err io.ptrace ?? -struct r_io_handle_t r_io_plugin_procpid = { +struct r_io_plugin_t r_io_plugin_procpid = { //void *handle; .name = "procpid", .desc = "proc/pid/mem io", @@ -132,7 +132,7 @@ struct r_io_handle_t r_io_plugin_procpid = { */ }; #else -struct r_io_handle_t r_io_plugin_ptrace = { +struct r_io_plugin_t r_io_plugin_ptrace = { .name = "procpid", .desc = "proc/pid/mem io (NOT SUPPORTED FOR THIS PLATFORM)", }; diff --git a/libr/io/p/io_ptrace.c b/libr/io/p/io_ptrace.c index 434b58af53..8405926a64 100644 --- a/libr/io/p/io_ptrace.c +++ b/libr/io/p/io_ptrace.c @@ -150,7 +150,7 @@ static int __init(struct r_io_t *io) { } // TODO: rename ptrace to io_ptrace .. err io.ptrace ?? -struct r_io_handle_t r_io_plugin_ptrace = { +struct r_io_plugin_t r_io_plugin_ptrace = { //void *handle; .name = "io_ptrace", .desc = "ptrace io", @@ -170,7 +170,7 @@ struct r_io_handle_t r_io_plugin_ptrace = { */ }; #else -struct r_io_handle_t r_io_plugin_ptrace = { +struct r_io_plugin_t r_io_plugin_ptrace = { .name = "ptrace", .desc = "ptrace io (NOT SUPPORTED FOR THIS PLATFORM)", }; diff --git a/libr/io/p/io_shm.c b/libr/io/p/io_shm.c index 17bd9a1529..e02bb7c090 100644 --- a/libr/io/p/io_shm.c +++ b/libr/io/p/io_shm.c @@ -87,7 +87,7 @@ static int shm__init(struct r_io_t *io) return R_TRUE; } -struct r_io_handle_t r_io_plugin_shm = { +struct r_io_plugin_t r_io_plugin_shm = { //void *handle; .name = "shm", .desc = "shared memory resources (shm://key)", diff --git a/libr/io/p/io_w32dbg.c b/libr/io/p/io_w32dbg.c index 558f6e9136..29d5534eba 100644 --- a/libr/io/p/io_w32dbg.c +++ b/libr/io/p/io_w32dbg.c @@ -91,7 +91,7 @@ static int __init(struct r_io_t *io) { } // TODO: rename w32dbg to io_w32dbg .. err io.w32dbg ?? -struct r_io_handle_t r_io_plugin_w32dbg = { +struct r_io_plugin_t r_io_plugin_w32dbg = { //void *handle; .name = "io_w32dbg", .desc = "w32dbg io", @@ -111,7 +111,7 @@ struct r_io_handle_t r_io_plugin_w32dbg = { */ }; #else -struct r_io_handle_t r_io_plugin_w32dbg = { +struct r_io_plugin_t r_io_plugin_w32dbg = { .name = "w32dbg", .desc = "w32dbg io (NOT SUPPORTED FOR THIS PLATFORM)", }; diff --git a/libr/io/undo.c b/libr/io/undo.c index 67f2333b03..b2a80e6119 100644 --- a/libr/io/undo.c +++ b/libr/io/undo.c @@ -5,7 +5,7 @@ #if 0 * TODO: * - make path of indirections shortr (io->undo.foo is slow) */ -* - Handle changes in write and seeks +* - Plugin changes in write and seeks * - Per-fd history log #endif diff --git a/libr/lang/lang.c b/libr/lang/lang.c index 4c2346f1c1..72142a0a29 100644 --- a/libr/lang/lang.c +++ b/libr/lang/lang.c @@ -73,7 +73,7 @@ R_API int r_lang_setup(RLang *lang) { return ret; } -R_API int r_lang_add(RLang *lang, struct r_lang_handle_t *foo) { +R_API int r_lang_add(RLang *lang, struct r_lang_plugin_t *foo) { if (foo->init) foo->init (lang->user); list_add_tail (&(foo->list), &(lang->langs)); @@ -84,7 +84,7 @@ R_API int r_lang_add(RLang *lang, struct r_lang_handle_t *foo) { R_API int r_lang_list(RLang *lang) { struct list_head *pos; list_for_each_prev (pos, &lang->langs) { - RLangHandle *h = list_entry (pos, RLangHandle, list); + RLangPlugin *h = list_entry (pos, RLangPlugin, list); printf (" %s: %s\n", h->name, h->desc); } return R_FALSE; @@ -93,7 +93,7 @@ R_API int r_lang_list(RLang *lang) { R_API int r_lang_use(RLang *lang, const char *name) { struct list_head *pos; list_for_each_prev(pos, &lang->langs) { - struct r_lang_handle_t *h = list_entry (pos, struct r_lang_handle_t, list); + struct r_lang_plugin_t *h = list_entry (pos, struct r_lang_plugin_t, list); if (!strcmp (h->name, name)) { lang->cur = h; return R_TRUE; diff --git a/libr/lang/p/dummy.c b/libr/lang/p/dummy.c index 171c401b4b..8fe0f19ed1 100644 --- a/libr/lang/p/dummy.c +++ b/libr/lang/p/dummy.c @@ -9,7 +9,7 @@ static int dummy_run(void *user, const char *code, int len) return R_TRUE; } -static struct r_lang_handle_t r_lang_plugin_dummy = { +static struct r_lang_plugin_t r_lang_plugin_dummy = { .name = "dummy", .desc = "Dummy language extension", .help = NULL, diff --git a/libr/lang/p/lua.c b/libr/lang/p/lua.c index 6f80d4aab3..299c7f9f55 100644 --- a/libr/lang/p/lua.c +++ b/libr/lang/p/lua.c @@ -95,7 +95,7 @@ static int lua_run(struct r_lang_t *lang, const char *code, int len) return R_TRUE; } -static struct r_lang_handle_t r_lang_plugin_lua = { +static struct r_lang_plugin_t r_lang_plugin_lua = { .name = "lua", .desc = "LUA language extension", .help = NULL, diff --git a/libr/lang/p/perl.c b/libr/lang/p/perl.c index aa38ccd8d4..db43562550 100644 --- a/libr/lang/p/perl.c +++ b/libr/lang/p/perl.c @@ -79,7 +79,7 @@ static const char *help = "Perl plugin usage:\n" " print \"r(\"pd 10\")\\n\";\n"; -static struct r_lang_handle_t r_lang_plugin_perl = { +static struct r_lang_plugin_t r_lang_plugin_perl = { .name = "perl", .desc = "Perl language extension", .init = &init, diff --git a/libr/lang/p/python.c b/libr/lang/p/python.c index 5c3d9f6512..8cd4951468 100644 --- a/libr/lang/p/python.c +++ b/libr/lang/p/python.c @@ -224,7 +224,7 @@ static const char *help = //" r = new RadareInternal()\n" " bytes = r.cmd(\"p8 10\");\n"; -struct r_lang_handle_t r_lang_plugin_python = { +struct r_lang_plugin_t r_lang_plugin_python = { .name = "python", .desc = "Python language extension", .init = &init, diff --git a/libr/lang/p/ruby.c b/libr/lang/p/ruby.c index 81f047de3b..a4ed9f5be0 100644 --- a/libr/lang/p/ruby.c +++ b/libr/lang/p/ruby.c @@ -89,7 +89,7 @@ static const char *help = " $r = RadareInternal.new()\n" " bytes = $r.cmd(\"p8 10\");\n"; -static struct r_lang_handle_t r_lang_plugin_ruby = { +static struct r_lang_plugin_t r_lang_plugin_ruby = { .name = "ruby", .desc = "Ruby language extension", .init = &init, diff --git a/libr/lang/p/tcc.c b/libr/lang/p/tcc.c index 6243c14af5..4ed0523c82 100644 --- a/libr/lang/p/tcc.c +++ b/libr/lang/p/tcc.c @@ -16,7 +16,7 @@ static int r_lang_tcc_run(struct r_lang_t *lang, const char *code, int len) return R_TRUE; } -static struct r_lang_handle_t r_lang_plugin_tcc = { +static struct r_lang_plugin_t r_lang_plugin_tcc = { .name = "c99", .desc = "C99 language extension (using libtcc)", .help = NULL, diff --git a/libr/lib/lib.c b/libr/lib/lib.c index 56292acc5a..629ba8b3aa 100644 --- a/libr/lib/lib.c +++ b/libr/lib/lib.c @@ -271,7 +271,7 @@ R_API int r_lib_del_handler(RLib *lib, int type) { R_API void r_lib_list(RLib *lib) { struct list_head *pos; #if 0 - printf("Plugin Handlers:\n"); + printf("Plugin Plugins:\n"); list_for_each_prev(pos, &lib->handlers) { RLibHandler *h = list_entry(pos, RLibHandler, list); printf(" - %d: %s\n", h->type, h->desc); diff --git a/libr/line/dietline.c b/libr/line/dietline.c index 3c1439f0e3..69e2cb14a5 100644 --- a/libr/line/dietline.c +++ b/libr/line/dietline.c @@ -39,7 +39,7 @@ static int r_line_readchar() { #if __WINDOWS__ BOOL ret; LPDWORD mode, out; - HANDLE h = GetStdHandle (STD_INPUT_HANDLE); + HANDLE h = GetStdPlugin (STD_INPUT_HANDLE); GetConsoleMode (h, &mode); SetConsoleMode (h, 0); // RAW diff --git a/libr/parse/p/parse_dummy.c b/libr/parse/p/parse_dummy.c index 54bbfa2c52..5b165d07c9 100644 --- a/libr/parse/p/parse_dummy.c +++ b/libr/parse/p/parse_dummy.c @@ -12,7 +12,7 @@ static int parse(struct r_parse_t *p, void *data, char *str) return R_FALSE; } -struct r_parse_handle_t r_parse_plugin_dummy = { +struct r_parse_plugin_t r_parse_plugin_dummy = { .name = "dummy", .desc = "dummy parsing plugin", .init = NULL, diff --git a/libr/parse/p/parse_mreplace.c b/libr/parse/p/parse_mreplace.c index 2158950b64..0d4ba78a18 100644 --- a/libr/parse/p/parse_mreplace.c +++ b/libr/parse/p/parse_mreplace.c @@ -27,7 +27,7 @@ static int parse(struct r_parse_t *p, void *data, char *str) return R_TRUE; } -struct r_parse_handle_t r_parse_plugin_mreplace = { +struct r_parse_plugin_t r_parse_plugin_mreplace = { .name = "mreplace", .desc = "mreplace parsing plugin", .init = NULL, @@ -38,7 +38,7 @@ struct r_parse_handle_t r_parse_plugin_mreplace = { }; #else -struct r_parse_handle_t r_parse_plugin_mreplace = { +struct r_parse_plugin_t r_parse_plugin_mreplace = { .name = "mreplace", .desc = "mreplace parsing plugin (NOT SUPPORTED FOR THIS PLATFORM)", }; diff --git a/libr/parse/p/parse_x86_pseudo.c b/libr/parse/p/parse_x86_pseudo.c index 564a629867..fd8fe6bb92 100644 --- a/libr/parse/p/parse_x86_pseudo.c +++ b/libr/parse/p/parse_x86_pseudo.c @@ -158,7 +158,7 @@ static int filter(struct r_parse_t *p, struct r_flag_t *f, char *data, char *str return R_FALSE; } -struct r_parse_handle_t r_parse_plugin_x86_pseudo = { +struct r_parse_plugin_t r_parse_plugin_x86_pseudo = { .name = "x86.pseudo", .desc = "X86 pseudo syntax", .init = NULL, diff --git a/libr/parse/parse.c b/libr/parse/parse.c index 641ba69705..cbf6a8c1f6 100644 --- a/libr/parse/parse.c +++ b/libr/parse/parse.c @@ -7,7 +7,7 @@ #include #include "../config.h" -static struct r_parse_handle_t *parse_static_plugins[] = +static struct r_parse_plugin_t *parse_static_plugins[] = { R_PARSE_STATIC_PLUGINS }; R_API struct r_parse_t *r_parse_new() { @@ -32,7 +32,7 @@ R_API void r_parse_set_user_ptr(struct r_parse_t *p, void *user) { p->user = user; } -R_API int r_parse_add(struct r_parse_t *p, struct r_parse_handle_t *foo) { +R_API int r_parse_add(struct r_parse_t *p, struct r_parse_plugin_t *foo) { if (foo->init) foo->init(p->user); list_add_tail(&(foo->list), &(p->parsers)); @@ -42,7 +42,7 @@ R_API int r_parse_add(struct r_parse_t *p, struct r_parse_handle_t *foo) { R_API int r_parse_list(struct r_parse_t *p) { struct list_head *pos; list_for_each_prev(pos, &p->parsers) { - struct r_parse_handle_t *h = list_entry(pos, struct r_parse_handle_t, list); + struct r_parse_plugin_t *h = list_entry(pos, struct r_parse_plugin_t, list); printf("parse %10s %s\n", h->name, h->desc); } return R_FALSE; @@ -51,7 +51,7 @@ R_API int r_parse_list(struct r_parse_t *p) { R_API int r_parse_use(struct r_parse_t *p, const char *name) { struct list_head *pos; list_for_each_prev(pos, &p->parsers) { - struct r_parse_handle_t *h = list_entry(pos, struct r_parse_handle_t, list); + struct r_parse_plugin_t *h = list_entry(pos, struct r_parse_plugin_t, list); if (!strcmp(h->name, name)) { p->cur = h; return R_TRUE; diff --git a/libr/syscall/win7.c b/libr/syscall/win7.c index c816713f93..1fe3c9f001 100644 --- a/libr/syscall/win7.c +++ b/libr/syscall/win7.c @@ -8,7 +8,7 @@ RSyscallItem syscalls_win7_x86[] = { { "NtAccessCheckByTypeAndAuditAlarm", 0x2e, 0x0004, 16 }, { "NtAccessCheckByTypeResultList", 0x2e, 0x0005, 11 }, { "NtAccessCheckByTypeResultListAndAuditAlarm", 0x2e, 0x0006, 16 }, - { "NtAccessCheckByTypeResultListAndAuditAlarmByHandle", 0x2e, 0x0007, 17 }, + { "NtAccessCheckByTypeResultListAndAuditAlarmByPlugin", 0x2e, 0x0007, 17 }, { "NtAddAtom", 0x2e, 0x0008, 3 }, { "NtAddBootEntry", 0x2e, 0x0009, 2 }, { "NtAddDriverEntry", 0x2e, 0x000a, 2 }, @@ -481,7 +481,7 @@ RSyscallItem syscalls_win7_x86[] = { { "NtGdiDdGetBltStatus", 0x2e, 0x104c, 2 }, { "NtGdiDdGetDC", 0x2e, 0x104d, 2 }, { "NtGdiDdGetDriverInfo", 0x2e, 0x104e, 2 }, - { "NtGdiDdGetDxHandle", 0x2e, 0x104f, 3 }, + { "NtGdiDdGetDxPlugin", 0x2e, 0x104f, 3 }, { "NtGdiDdGetFlipStatus", 0x2e, 0x1050, 2 }, { "NtGdiDdGetInternalMoCompInfo", 0x2e, 0x1051, 2 }, { "NtGdiDdGetMoCompBuffInfo", 0x2e, 0x1052, 2 }, @@ -598,7 +598,7 @@ RSyscallItem syscalls_win7_x86[] = { { "NtGdiGetMonitorID", 0x2e, 0x10c1, 3 }, { "NtGdiGetNearestColor", 0x2e, 0x10c2, 2 }, { "NtGdiGetNearestPaletteIndex", 0x2e, 0x10c3, 2 }, - { "NtGdiGetObjectBitmapHandle", 0x2e, 0x10c4, 2 }, + { "NtGdiGetObjectBitmapPlugin", 0x2e, 0x10c4, 2 }, { "NtGdiGetOPMRandomNumber", 0x2e, 0x10c5, 2 }, { "NtGdiGetOutlineTextMetricsInternalW", 0x2e, 0x10c6, 4 }, { "NtGdiGetPath", 0x2e, 0x10c7, 4 }, @@ -755,14 +755,14 @@ RSyscallItem syscalls_win7_x86[] = { { "NtUserCloseDesktop", 0x2e, 0x115e, 1 }, { "NtUserCloseWindowStation", 0x2e, 0x115f, 1 }, { "NtUserConsoleControl", 0x2e, 0x1160, 3 }, - { "NtUserConvertMemHandle", 0x2e, 0x1161, 2 }, + { "NtUserConvertMemPlugin", 0x2e, 0x1161, 2 }, { "NtUserCopyAcceleratorTable", 0x2e, 0x1162, 3 }, { "NtUserCountClipboardFormats", 0x2e, 0x1163, 0 }, { "NtUserCreateAcceleratorTable", 0x2e, 0x1164, 2 }, { "NtUserCreateCaret", 0x2e, 0x1165, 4 }, { "NtUserCreateDesktopEx", 0x2e, 0x1166, 6 }, { "NtUserCreateInputContext", 0x2e, 0x1167, 1 }, - { "NtUserCreateLocalMemHandle", 0x2e, 0x1168, 4 }, + { "NtUserCreateLocalMemPlugin", 0x2e, 0x1168, 4 }, { "NtUserCreateWindowEx", 0x2e, 0x1169, 15 }, { "NtUserCreateWindowStation", 0x2e, 0x116a, 8 }, { "NtUserDdeInitialize", 0x2e, 0x116b, 5 }, @@ -973,7 +973,7 @@ RSyscallItem syscalls_win7_x86[] = { { "NtUserSetSystemMenu", 0x2e, 0x1238, 2 }, { "NtUserSetSystemTimer", 0x2e, 0x1239, 3 }, { "NtUserSetThreadDesktop", 0x2e, 0x123a, 1 }, - { "NtUserSetThreadLayoutHandles", 0x2e, 0x123b, 2 }, + { "NtUserSetThreadLayoutPlugins", 0x2e, 0x123b, 2 }, { "NtUserSetThreadState", 0x2e, 0x123c, 2 }, { "NtUserSetTimer", 0x2e, 0x123d, 4 }, { "NtUserSetProcessDPIAware", 0x2e, 0x123e, 0 }, @@ -1022,8 +1022,8 @@ RSyscallItem syscalls_win7_x86[] = { { "NtUserGetLayeredWindowAttributes", 0x2e, 0x1269, 4 }, { "NtUserSetLayeredWindowAttributes", 0x2e, 0x126a, 4 }, { "NtUserUpdatePerUserSystemParameters", 0x2e, 0x126b, 1 }, - { "NtUserUserHandleGrantAccess", 0x2e, 0x126c, 3 }, - { "NtUserValidateHandleSecure", 0x2e, 0x126d, 1 }, + { "NtUserUserPluginGrantAccess", 0x2e, 0x126c, 3 }, + { "NtUserValidatePluginSecure", 0x2e, 0x126d, 1 }, { "NtUserValidateRect", 0x2e, 0x126e, 2 }, { "NtUserValidateTimerCallback", 0x2e, 0x126f, 1 }, { "NtUserVkKeyScanEx", 0x2e, 0x1270, 3 }, @@ -1063,7 +1063,7 @@ RSyscallItem syscalls_win7_x86[] = { { "NtUserInjectGesture", 0x2e, 0x1292, 5 }, { "NtUserGetGestureInfo", 0x2e, 0x1293, 2 }, { "NtUserGetGestureExtArgs", 0x2e, 0x1294, 3 }, - { "NtUserManageGestureHandlerWindow", 0x2e, 0x1295, 2 }, + { "NtUserManageGesturePluginWindow", 0x2e, 0x1295, 2 }, { "NtUserSetGestureConfig", 0x2e, 0x1296, 5 }, { "NtUserGetGestureConfig", 0x2e, 0x1297, 6 }, { "NtGdiEngAssociateSurface", 0x2e, 0x1298, 3 }, @@ -1114,7 +1114,7 @@ RSyscallItem syscalls_win7_x86[] = { { "NtGdiFONTOBJ_pfdg", 0x2e, 0x12c5, 1 }, { "NtGdiFONTOBJ_pQueryGlyphAttrs", 0x2e, 0x12c6, 2 }, { "NtGdiFONTOBJ_pvTrueTypeFontFile", 0x2e, 0x12c7, 2 }, - { "NtGdiFONTOBJ_cGetAllGlyphHandles", 0x2e, 0x12c8, 2 }, + { "NtGdiFONTOBJ_cGetAllGlyphPlugins", 0x2e, 0x12c8, 2 }, { "NtGdiSTROBJ_bEnum", 0x2e, 0x12c9, 3 }, { "NtGdiSTROBJ_bEnumPositionsOnly", 0x2e, 0x12ca, 3 }, { "NtGdiSTROBJ_bGetAdvanceWidths", 0x2e, 0x12cb, 4 }, @@ -1164,7 +1164,7 @@ RSyscallItem syscalls_win7_x86[] = { { "NtGdiDdDDIOpenAdapterFromDeviceName", 0x2e, 0x12f7, 1 }, { "NtGdiDdDDIOpenAdapterFromHdc", 0x2e, 0x12f8, 1 }, { "NtGdiDdDDICloseAdapter", 0x2e, 0x12f9, 1 }, - { "NtGdiDdDDIGetSharedPrimaryHandle", 0x2e, 0x12fa, 1 }, + { "NtGdiDdDDIGetSharedPrimaryPlugin", 0x2e, 0x12fa, 1 }, { "NtGdiDdDDIEscape", 0x2e, 0x12fb, 1 }, { "NtGdiDdDDIQueryStatistics", 0x2e, 0x12fc, 1 }, { "NtGdiDdDDISetVidPnSourceOwner", 0x2e, 0x12fd, 1 }, diff --git a/libr/th/lock.c b/libr/th/lock.c index 62d8c1de0c..fe7334efee 100644 --- a/libr/th/lock.c +++ b/libr/th/lock.c @@ -71,7 +71,7 @@ R_API void *r_th_lock_free(struct r_th_lock_t *thl) pthread_mutex_destroy(&thl->lock); #elif __WIN32__ DeleteCriticalSection(&thl->lock); - CloseHandle(thl->lock); + ClosePlugin(thl->lock); #endif free(thl); } diff --git a/libr/util/w32-sys.c b/libr/util/w32-sys.c index a853eeb282..354570fdaf 100644 --- a/libr/util/w32-sys.c +++ b/libr/util/w32-sys.c @@ -30,9 +30,9 @@ R_API char *r_sys_cmd_str_w32(const char *cmd) { SECURITY_ATTRIBUTES saAttr; char *argv0 = getexe (cmd); - // Set the bInheritHandle flag so pipe handles are inherited. + // Set the bInheritPlugin flag so pipe handles are inherited. saAttr.nLength = sizeof (SECURITY_ATTRIBUTES); - saAttr.bInheritHandle = TRUE; + saAttr.bInheritPlugin = TRUE; saAttr.lpSecurityDescriptor = NULL; HANDLE fh; @@ -41,8 +41,8 @@ R_API char *r_sys_cmd_str_w32(const char *cmd) { ErrorExit ("StdoutRd CreatePipe"); // Ensure the read handle to the pipe for STDOUT is not inherited. - if (!SetHandleInformation (fh, HANDLE_FLAG_INHERIT, 0) ) - ErrorExit ("Stdout SetHandleInformation"); + if (!SetPluginInformation (fh, HANDLE_FLAG_INHERIT, 0) ) + ErrorExit ("Stdout SetPluginInformation"); CreateChildProcess (cmd, out); @@ -61,8 +61,8 @@ R_API char *r_sys_cmd_str_w32(const char *cmd) { // read end of the pipe, to control child process execution. // The pipe is assumed to have enough buffer space to hold the // data the child process has already written to it. - if (!CloseHandle (out)) - ErrorExit ("StdOutWr CloseHandle"); + if (!ClosePlugin (out)) + ErrorExit ("StdOutWr ClosePlugin"); ret = ReadFromPipe (fh); free (argv0); @@ -97,8 +97,8 @@ static int CreateChildProcess(const char *szCmdline, HANDLE out) { &piProcInfo); // receives PROCESS_INFORMATION if (bSuccess) { - CloseHandle (piProcInfo.hProcess); - CloseHandle (piProcInfo.hThread); + ClosePlugin (piProcInfo.hProcess); + ClosePlugin (piProcInfo.hThread); } else r_sys_perror ("CreateProcess"); return bSuccess; } diff --git a/swig/vapi/r_asm.vapi b/swig/vapi/r_asm.vapi index 533c3b02ea..767a5d045d 100644 --- a/swig/vapi/r_asm.vapi +++ b/swig/vapi/r_asm.vapi @@ -28,8 +28,8 @@ public class RAsm { } [Compact] - [CCode (cname="RAsmHandler", destroy_function="" )] - public class Handler { + [CCode (cname="RAsmPlugin", destroy_function="" )] + public class Plugin { public string name; public string arch; public string desc; @@ -66,7 +66,7 @@ public class RAsm { public string buf_err; public void *aux; - public RList handlers; + public RList handlers; public RAsm(); public bool use(string name); public bool set_bits(int bits); diff --git a/swig/vapi/r_cmd.vapi b/swig/vapi/r_cmd.vapi index 121d292620..8ef23375b6 100644 --- a/swig/vapi/r_cmd.vapi +++ b/swig/vapi/r_cmd.vapi @@ -6,7 +6,7 @@ namespace Radare { [CCode (cheader_filename="r_lib.h", cprefix="r_lib_struct_", cname="struct r_lib_struct_t", free_function="", destroy_function="")] public struct RCmdStruct { public RLibType type; - public RCmdHandle data; + public RCmdPlugin data; } [Compact] @@ -19,8 +19,8 @@ namespace Radare { [CCode (has_target=false, cname="RCmdCallback")] public delegate bool RCmdCallback (void *user, string cmd); - [CCode (cheader_filename="r_cmd.h", cname="RCmdHandle", free_function="", destroy_function="")] - public struct RCmdHandle { + [CCode (cheader_filename="r_cmd.h", cname="RCmdPlugin", free_function="", destroy_function="")] + public struct RCmdPlugin { string name; RCmdCallback call; } diff --git a/swig/vapi/r_diff.vapi b/swig/vapi/r_diff.vapi index bf519df99a..d307519a8b 100644 --- a/swig/vapi/r_diff.vapi +++ b/swig/vapi/r_diff.vapi @@ -11,8 +11,8 @@ namespace Radare { //public static int lines (string file, string sa, int la, string file2, string sb, int lb); [Compact] - [CCode (cname="struct r_diff_handle_t", destroy_function="", free_function="" )] - public struct Handle { + [CCode (cname="struct r_diff_plugin_t", destroy_function="", free_function="" )] + public struct Plugin { public uint64 a_off; public uint8* a_buf; public int a_len; diff --git a/swig/vapi/r_io.vapi b/swig/vapi/r_io.vapi index 4c35c14b44..672fed0444 100644 --- a/swig/vapi/r_io.vapi +++ b/swig/vapi/r_io.vapi @@ -57,17 +57,17 @@ namespace Radare { /* handle */ [Compact] - [CCode (cname="RIOHandle", cprefix="r_io_handle_", free_function="")] - public class Handle { + [CCode (cname="RIOPlugin", cprefix="r_io_handle_", free_function="")] + public class Plugin { string name; string desc; // TODO: lot of missing stuff here :) } - /* TODO: make them methods of Handle class ? */ - public bool handle_open(int fd, Handle plugin); - public bool handle_close(int fd, Handle plugin); - public bool handle_add(Handle plugin); + /* TODO: make them methods of Plugin class ? */ + public bool handle_open(int fd, Plugin plugin); + public bool handle_close(int fd, Plugin plugin); + public bool handle_add(Plugin plugin); public int handle_generate(); public void handle_list(); @@ -115,6 +115,6 @@ namespace Radare { const string name; } // int perms -> RIOPerm ? - public bool desc_add(int fd, string file, int perms, Handle handle); + public bool desc_add(int fd, string file, int perms, Plugin handle); } } diff --git a/swig/vapi/r_lang.vapi b/swig/vapi/r_lang.vapi index 7863aa0e5d..43fb870a09 100644 --- a/swig/vapi/r_lang.vapi +++ b/swig/vapi/r_lang.vapi @@ -7,7 +7,7 @@ namespace Radare { public class RLang { public RLang (); public bool define(string type, string name, void* ptr); - public bool @add(RLang.Handler handler); + public bool @add(RLang.Plugin handler); public bool use(string name); public bool undef(); public bool list(); @@ -17,14 +17,14 @@ namespace Radare { public bool prompt(); [Compact] - [CCode (cname="struct r_lang_handle_t", destroy_function="", free_function="" )] - public class Handler { + [CCode (cname="struct r_lang_plugin_t", destroy_function="", free_function="" )] + public class Plugin { public string name; public string desc; public string help; } - public Handler cur; + public Plugin cur; } } diff --git a/swig/vapi/r_lib.vapi b/swig/vapi/r_lib.vapi index 8929c91272..6bf6ef138c 100644 --- a/swig/vapi/r_lib.vapi +++ b/swig/vapi/r_lib.vapi @@ -18,11 +18,11 @@ namespace Radare { // we need delegates here (function pointerz) // public bool add_handler(int type, string desc, /* */, void* user); public bool del_handler(int type); - public Handler get_handler(int type); + public Plugin get_handler(int type); //public struct Struct { } [Compact] [CCode (cname="struct r_lib_handler_t*")] - public struct Handler { + public struct Plugin { int type; string desc; void* user; diff --git a/swig/vapi/t/io.vala b/swig/vapi/t/io.vala index 7c723306da..5f95b8427b 100644 --- a/swig/vapi/t/io.vala +++ b/swig/vapi/t/io.vala @@ -13,9 +13,9 @@ void main(string[] args) print ("0x8048000 : %02x %02x %02x %02x\n", buf[0], buf[1], buf[2], buf[3]); /* - Radare.List handle = io.handlers; + Radare.List handle = io.handlers; while (!handle->last()) { - print(" Handle: %s\n", handle->name); + print(" Plugin: %s\n", handle->name); handle = handle->next(); } handle->free(); diff --git a/swig/vapi/t/plugin.vala b/swig/vapi/t/plugin.vala index a15ac61c28..0df7247786 100644 --- a/swig/vapi/t/plugin.vala +++ b/swig/vapi/t/plugin.vala @@ -26,7 +26,7 @@ private bool mycall(void *user, string cmd) { return false; } -private const RCmdHandle plugin = { +private const RCmdPlugin plugin = { "my plugin", mycall };