Fix asm.arch=?asf issue, implement asm.syntax=?

This commit is contained in:
pancake 2014-04-11 02:22:41 +02:00
parent 77b2e5fcc2
commit 774ccc71a0
3 changed files with 13 additions and 7 deletions

View File

@ -156,7 +156,7 @@ static int cb_asmarch(void *user, void *data) {
RConfigNode *node = (RConfigNode *) data;
const char *asmos = core->config? r_config_get (core->config, "asm.os"): NULL;
if (!strcmp (node->value, "?")) {
if (*node->value=='?') {
rasm2_list (core->assembler, NULL);
return 0;
}
@ -223,7 +223,7 @@ static int cb_asmbits(void *user, void *data) {
static int cb_asmcpu(void *user, void *data) {
RCore *core = (RCore *) user;
RConfigNode *node = (RConfigNode *) data;
if (!strcmp (node->value, "?")) {
if (*node->value=='?') {
rasm2_list (core->assembler,
r_config_get (core->config, "asm.arch"));
return 0;
@ -271,11 +271,14 @@ static int cb_asmprofile(void *user, void *data) {
static int cb_asmsyntax(void *user, void *data) {
RCore *core = (RCore*) user;
RConfigNode *node = (RConfigNode*) data;
if (!strcmp (node->value, "intel"))
if (*node->value == '?') {
r_cons_printf ("att\nintel\n");
return R_FALSE;
} else if (!strcmp (node->value, "intel")) {
r_asm_set_syntax (core->assembler, R_ASM_SYNTAX_INTEL);
else if (!strcmp (node->value, "att"))
} else if (!strcmp (node->value, "att")) {
r_asm_set_syntax (core->assembler, R_ASM_SYNTAX_ATT);
else return R_FALSE;
} else return R_FALSE;
return R_TRUE;
}
@ -386,7 +389,7 @@ static int cb_fsview(void *user, void *data) {
int type = R_FS_VIEW_NORMAL;
RCore *core = (RCore *) user;
RConfigNode *node = (RConfigNode *) data;
if (!strcmp (node->value, "?")) {
if (*node->value == '?') {
eprintf ("Values: all|deleted|special\n");
return R_FALSE;
}

View File

@ -10,7 +10,8 @@
static RSocket *s = NULL;
static const char *listenport = NULL;
static void http_break (void *u) {
#define http_break r_core_rtr_http_stop
R_API int r_core_rtr_http_stop(RCore *u) {
RSocket* sock;
const char *port;
const int timeout = 1; // 1 second
@ -23,6 +24,7 @@ static void http_break (void *u) {
}
r_socket_free (s);
s = NULL;
return 0;
}
#if 0

View File

@ -358,6 +358,7 @@ R_API void r_core_rtr_remove(RCore *core, const char *input);
R_API void r_core_rtr_session(RCore *core, const char *input);
R_API void r_core_rtr_cmd(RCore *core, const char *input);
R_API int r_core_rtr_http(RCore *core, int launch, const char *path);
R_API int r_core_rtr_http_stop(RCore *u);
R_API void r_core_visual_define (RCore *core);
R_API void r_core_visual_config (RCore *core);