summaryrefslogtreecommitdiffstats
path: root/source/helper.c
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-01-31 18:23:17 +0100
committerQC <qball@gmpclient.org>2015-01-31 18:23:17 +0100
commitb74e6b791a09880a3699ce8199a47786a70ca575 (patch)
tree06d4670fb5b9c72d38e38444c416f1e480c74bf0 /source/helper.c
parent983fff61b456b202c90552beeea85ab75499ee3a (diff)
Fix not grabbing keyboard, and add pid file to ensure one instance.
Diffstat (limited to 'source/helper.c')
-rw-r--r--source/helper.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/helper.c b/source/helper.c
index cc077a83..e04a6ea2 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -185,6 +185,16 @@ int find_arg_str ( const int argc, char * const argv[], const char * const key,
}
return FALSE;
}
+int find_arg_str_alloc ( const int argc, char * const argv[], const char * const key, char** val )
+{
+ int i = find_arg ( argc, argv, key );
+
+ if ( val != NULL && i > 0 && i < argc - 1 ) {
+ *val = g_strdup ( argv[i + 1] );
+ return TRUE;
+ }
+ return FALSE;
+}
int find_arg_int ( const int argc, char * const argv[], const char * const key, int *val )
{