myadm

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

commit 6b44dfbfe37e3c3fff08cbf135ed1a447b78bf03
parent d63fbe43ed93fb1a857e47c0f5c500196a6aa6a2
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Wed,  2 Mar 2016 17:39:47 +0100

Add config.def.h

Diffstat:
MMakefile | 6+++++-
Aconfig.def.h | 31+++++++++++++++++++++++++++++++
Dconfig.h | 31-------------------------------
3 files changed, 36 insertions(+), 32 deletions(-)

diff --git a/Makefile b/Makefile @@ -19,7 +19,11 @@ options: @echo CC $< @${CC} -c ${CFLAGS} $< -${OBJ}: config.mk +${OBJ}: config.h config.mk + +config.h: + @echo creating $@ from config.def.h + @cp config.def.h $@ ${APPNAME}: ${OBJ} @echo CC -o $@ diff --git a/config.def.h b/config.def.h @@ -0,0 +1,31 @@ +/* See LICENSE file for copyright and license details. */ + +static const char *dbhost = ""; +static const char *dbuser = ""; +static const char *dbpass = ""; + +static Mode modes[] = { + /* name show function */ + { "databases", databases }, /* first entry is default */ + { "tables", tables }, + { "records", records }, + { "text", text }, +}; + +static Key keys[] = { + /* mode modkey function argument */ + { NULL, L"Q", quit, {.i = 1} }, + { NULL, L"q", viewprev, {0} }, + { NULL, L"k", itempos, {.i = -1} }, + { NULL, L"j", itempos, {.i = +1} }, + { NULL, L"I", reload, {0} }, + { NULL, L"$", apply, {.i = 1} }, + { "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} }, + { "records", L"d", flagas, {.v = "D"} }, + { "records", L"t", flagas, {.v = "*"} }, +}; diff --git a/config.h b/config.h @@ -1,31 +0,0 @@ -/* See LICENSE file for copyright and license details. */ - -static const char *dbhost = "localhost"; -static const char *dbuser = "root"; -static const char *dbpass = "m0r3s3cur3"; - -static Mode modes[] = { - /* name show function */ - { "databases", databases }, /* first entry is default */ - { "tables", tables }, - { "records", records }, - { "text", text }, -}; - -static Key keys[] = { - /* mode modkey function argument */ - { NULL, L"Q", quit, {.i = 1} }, - { NULL, L"q", viewprev, {0} }, - { NULL, L"k", itempos, {.i = -1} }, - { NULL, L"j", itempos, {.i = +1} }, - { NULL, L"I", reload, {0} }, - { NULL, L"$", apply, {.i = 1} }, - { "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} }, - { "records", L"d", flagas, {.v = "D"} }, - { "records", L"t", flagas, {.v = "*"} }, -};