From 176a7359271a531c02e44f09a9d7dd80777f0b54 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 31 May 2016 02:32:30 +0200 Subject: [PATCH] Add cmdf callback and license in RLang --- libr/core/core.c | 1 + libr/include/r_lang.h | 3 +++ libr/lang/p/vala.c | 7 ++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libr/core/core.c b/libr/core/core.c index 8aafd9261e..9e4819b4c6 100644 --- a/libr/core/core.c +++ b/libr/core/core.c @@ -1293,6 +1293,7 @@ R_API int r_core_init(RCore *core) { core->cons->num = core->num; core->lang = r_lang_new (); core->lang->cmd_str = (char *(*)(void *, const char *))r_core_cmd_str; + core->lang->cmdf = (int (*)(void *, const char *, ...))r_core_cmdf; core->cons->editor = (RConsEditorCallback)r_core_editor; core->cons->user = (void*)core; core->lang->cb_printf = r_cons_printf; diff --git a/libr/include/r_lang.h b/libr/include/r_lang.h index 2eae17b153..87529a637b 100644 --- a/libr/include/r_lang.h +++ b/libr/include/r_lang.h @@ -11,6 +11,7 @@ extern "C" { R_LIB_VERSION_HEADER(r_lang); typedef char* (*RCoreCmdStrCallback)(void* core, const char *s); +typedef int (*RCoreCmdfCallback)(void* core, const char *s, ...); typedef struct r_lang_t { struct r_lang_plugin_t *cur; @@ -19,11 +20,13 @@ typedef struct r_lang_t { RList *langs; PrintfCallback cb_printf; RCoreCmdStrCallback cmd_str; + RCoreCmdfCallback cmdf; } RLang; typedef struct r_lang_plugin_t { const char *name; const char *desc; + const char *license; const char **help; const char *ext; int (*init)(RLang *user); diff --git a/libr/lang/p/vala.c b/libr/lang/p/vala.c index f3969d4194..9bd1b25eea 100644 --- a/libr/lang/p/vala.c +++ b/libr/lang/p/vala.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2011-2014 pancake */ +/* radare - LGPL - Copyright 2011-2016 pancake */ /* vala extension for libr (radare2) */ // TODO: add cache directory (~/.r2/cache) @@ -94,11 +94,8 @@ static int lang_vala_run(RLang *lang, const char *code, int len) { static struct r_lang_plugin_t r_lang_plugin_vala = { .name = "vala", .ext = "vala", - .desc = "VALA language extension", - .help = NULL, + .desc = "Vala language extension", .run = lang_vala_run, .init = (void*)lang_vala_init, - .fini = NULL, .run_file = (void*)lang_vala_file, - .set_argv = NULL, };