myadm

Simple MySQL client for the terminal
git clone git://git.bitsmanent.org/myadm
Log | Files | Refs | README | LICENSE

commit a6c877a2cc16c7b2fdaba8e5122249163488164b
parent 039c2d0020fc07a98e8a077e91118ba5c07a028c
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Thu,  3 Mar 2016 14:12:13 +0100

Clean up

Diffstat:
Mconfig.def.h | 5++---
Mcore.c | 15++++-----------
2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -23,9 +23,8 @@ static Key keys[] = { { "databases", L"q", quit, {.i = 0} }, { "databases", L"ENTER", usedb, {.v = &modes[1]} }, { "databases", L"SPACE", usedb, {.v = &modes[1]} }, - { "tables", L"ENTER", usetable, {.v = &modes[2]} }, - { "tables", L"SPACE", usetable, {.v = &modes[2]} }, - { "records", L"ENTER", userecord, {0} }, + { "tables", L"ENTER", setmode, {.v = &modes[2]} }, + { "tables", L"SPACE", setmode, {.v = &modes[2]} }, { "records", L"d", flagas, {.v = "D"} }, { "records", L"t", flagas, {.v = "*"} }, }; diff --git a/core.c b/core.c @@ -86,8 +86,6 @@ void quit(const Arg *arg); void setmode(const Arg *arg); void viewprev(const Arg *arg); void usedb(const Arg *arg); -void usetable(const Arg *arg); -void userecord(const Arg *arg); void itempos(const Arg *arg); void reload(const Arg *arg); @@ -121,6 +119,10 @@ choose(const char *msg, char *opts) { return *o; } +/* XXX Improved logic: + * -1 only ask if there are pending changes + * 1 always ask + * 0 never ask */ void quit(const Arg *arg) { if(arg->i) { @@ -383,15 +385,6 @@ usedb(const Arg *arg) { } void -usetable(const Arg *arg) { - setmode(arg); -} - -void -userecord(const Arg *arg) { -} - -void itempos(const Arg *arg) { int pos = atoi(stfl_ipool_fromwc(ipool, stfl_get(selview->form, L"pos"))); char tmp[8];