コード例 #1
0
ファイル: visual.c プロジェクト: xuwenbo/radare2
R_API int r_core_visual_hud(RCore *core) {
	const char *c = r_config_get (core->config, "hud.path");
	const char *f = R2_LIBDIR"/radare2/"R2_VERSION"/hud/main";
	char *homehud = r_str_home (R2_HOMEDIR"/hud");
	char *res = NULL;
	char *p = 0;

	showcursor (core, true);
	if (c && *c && r_file_exists (c))
		res = r_cons_hud_file (c);
	if (!res && homehud)
		res = r_cons_hud_file (homehud);
	if (!res && r_file_exists (f))
		res = r_cons_hud_file (f);
	if (!res)
		r_cons_message ("Cannot find hud file");

	r_cons_clear ();
	if (res) {
		p = strchr (res, '\t');
		r_cons_printf ("%s\n", res);
		r_cons_flush ();
		if (p) r_core_cmd0 (core, p+1);
		free (res);
	}
	showcursor (core, false);
	r_cons_flush ();
	free (homehud);
	return (int)(size_t)p;
}
コード例 #2
0
ファイル: visual.c プロジェクト: revskills/radare2
static int r_core_visual_hud(RCore *core) {
    const char *f = R2_LIBDIR"/radare2/"R2_VERSION"/hud/main";
    char *homehud = r_str_home (R2_HOMEDIR"/hud");
    char *res = NULL;
    char *p = 0;

    showcursor (core, R_TRUE);
    if (homehud)
        res = r_cons_hud_file (homehud);
    if (!res) {
        if (r_file_exists (f))
            res = r_cons_hud_file (f);
        else r_cons_message ("Cannot find hud file");
    }
    r_cons_clear ();
    if (res) {
        p = strchr (res, '\t');
        core->printidx = 1;
        r_cons_printf ("%s\n", res);
        r_cons_flush ();
        if (p) r_core_cmd0 (core, p+1);
        free (res);
    }
    showcursor (core, R_FALSE);
    r_cons_flush ();
    free (homehud);
    return (int)(size_t)p;
}