mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-19 04:12:46 +00:00
Add cmdf callback and license in RLang
This commit is contained in:
parent
8939958569
commit
176a735927
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user