diff options
| author | LarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-02-10 16:44:02 +0000 |
|---|---|---|
| committer | LarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-02-10 16:44:02 +0000 |
| commit | c17ecbd260b3304b60fedfa70999f2eccabb668d (patch) | |
| tree | 807d11dd2b17542b5927294333d67a9c9859f4c3 | |
| parent | 7f05158de27dfaccd256c5436994dbbf418504e1 (diff) | |
| download | vdr-plugin-muggle-c17ecbd260b3304b60fedfa70999f2eccabb668d.tar.gz vdr-plugin-muggle-c17ecbd260b3304b60fedfa70999f2eccabb668d.tar.bz2 | |
Enhanced to cover mySQL embedded library
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk@473 e10066b5-e1e2-0310-b819-94efdf66514b
| -rw-r--r-- | muggle-plugin/Makefile | 1 | ||||
| -rwxr-xr-x | muggle-plugin/mugglei.c | 25 |
2 files changed, 25 insertions, 1 deletions
diff --git a/muggle-plugin/Makefile b/muggle-plugin/Makefile index d2439e5..48d42e7 100644 --- a/muggle-plugin/Makefile +++ b/muggle-plugin/Makefile @@ -61,6 +61,7 @@ OBJS = $(PLUGIN).o i18n.o mg_valmap.o mg_order.o mg_db.o mg_actions.o vdr_menu.o LIBS = -lmad -lmysqlclient MILIBS = -lmysqlclient -ltag +# MILIBS = -lmysqld -lpthread -lz -lcrypt -lnsl -lm -lpthread -lrt -lwrap -ltag ifdef HAVE_VORBISFILE DEFINES += -DHAVE_VORBISFILE diff --git a/muggle-plugin/mugglei.c b/muggle-plugin/mugglei.c index 79c68f6..a31a601 100755 --- a/muggle-plugin/mugglei.c +++ b/muggle-plugin/mugglei.c @@ -34,6 +34,21 @@ MYSQL *db; +static char *server_args[] = +{ + "this_program", /* this string is not used */ + "--datadir=.", + "--key_buffer_size=32M" +}; + +static char *server_groups[] = +{ + "embedded", + "server", + "this_program_SERVER", + (char *)NULL +}; + std::string host, user, pass, dbname, sck; bool import_assorted, delete_mode; @@ -452,8 +467,13 @@ void evaluate_file( std::string filename ) int main( int argc, char *argv[] ) { + if( mysql_server_init(sizeof(server_args) / sizeof(char *), + server_args, server_groups) ) + { + exit(1); + } std::string filename; - + if( argc < 2 ) { // we need at least a filename! std::cout << "mugglei -- import helper for Muggle VDR plugin" << std::endl; @@ -554,6 +574,9 @@ int main( int argc, char *argv[] ) evaluate_file( filename ); } } + + mysql_server_end(); + return 0; } |
