diff options
author | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-10-04 07:30:45 +0000 |
---|---|---|
committer | lvw <lvw@e10066b5-e1e2-0310-b819-94efdf66514b> | 2004-10-04 07:30:45 +0000 |
commit | ac0b4a4ad469f9689a4f83f1e3b9ebc823ba4703 (patch) | |
tree | 0cb30b1131eacb3869c4c70e79f1d0927c2103d9 /muggle-plugin/muggle.c | |
parent | c252169fa4948d7bfd7ac7b6b7e13d2b913d8f76 (diff) | |
download | vdr-plugin-muggle-ac0b4a4ad469f9689a4f83f1e3b9ebc823ba4703.tar.gz vdr-plugin-muggle-ac0b4a4ad469f9689a4f83f1e3b9ebc823ba4703.tar.bz2 |
Added patch for using sockets and improved menu translations
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk@199 e10066b5-e1e2-0310-b819-94efdf66514b
Diffstat (limited to 'muggle-plugin/muggle.c')
-rw-r--r-- | muggle-plugin/muggle.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/muggle-plugin/muggle.c b/muggle-plugin/muggle.c index 92e9831..a952c43 100644 --- a/muggle-plugin/muggle.c +++ b/muggle-plugin/muggle.c @@ -49,6 +49,7 @@ mgMuggle::mgMuggle(void) { // defaults for database arguments the_setup.DbHost = strdup ("localhost"); + the_setup.DbSocket = NULL; the_setup.DbPort = 0; the_setup.DbName = strdup ("GiantDisc"); the_setup.DbUser = strdup (""); @@ -67,6 +68,7 @@ const char *mgMuggle::CommandLineHelp(void) // Return a string that describes all known command line options. return " -h HHHH, --host=HHHH specify database host (default is localhost)\n" + " -s SSSS --socket=PATH specify database socket (default is TCP connection)\n" " -n NNNN, --name=NNNN specify database name (overridden by -g)\n" " -p PPPP, --port=PPPP specify port of database server (default is )\n" " -u UUUU, --user=UUUU specify database user (default is )\n" @@ -83,6 +85,7 @@ bool mgMuggle::ProcessArgs(int argc, char *argv[]) static struct option long_options[] = { { "host", required_argument, NULL, 'h' }, + { "socket", required_argument, NULL, 's' }, { "name", required_argument, NULL, 'n' }, { "port", required_argument, NULL, 'p' }, { "user", required_argument, NULL, 'u' }, @@ -93,7 +96,7 @@ bool mgMuggle::ProcessArgs(int argc, char *argv[]) }; int c, option_index = 0; - while( ( c = getopt_long( argc, argv, "gh:n:p:t:u:w:", long_options, &option_index ) ) != -1 ) + while( ( c = getopt_long( argc, argv, "gh:s:n:p:t:u:w:", long_options, &option_index ) ) != -1 ) { switch (c) { @@ -101,6 +104,10 @@ bool mgMuggle::ProcessArgs(int argc, char *argv[]) { the_setup.DbHost = strcpyrealloc (the_setup.DbHost, optarg); } break; + case 's': + { + the_setup.DbSocket = strcpyrealloc (the_setup.DbSocket, optarg); + } break; case 'n': { the_setup.DbName = strcpyrealloc (the_setup.DbName, optarg); |