From 062b7e6d238f8d4fa3580087a4e2962ae322625f Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 16 Sep 2017 15:02:42 -0400 Subject: mq_window_new(): Accept NULL-terminated uris array --- diff --git a/src/main.c b/src/main.c index ecf0a7b..50bb896 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,7 @@ static gchar *opt_profile; static gboolean opt_private; static gboolean opt_version; +static gchar **opt_uris; static GOptionEntry entries[] = { {"profile", 'P', G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING, @@ -46,6 +47,11 @@ static GOptionEntry entries[] = { &opt_version, "Show application version", NULL}, + {G_OPTION_REMAINING, '\0', + G_OPTION_FLAG_NONE, G_OPTION_ARG_STRING_ARRAY, + &opt_uris, + "URIs", + NULL}, {NULL} }; @@ -73,7 +79,7 @@ main(int argc, char *argv[]) return EXIT_SUCCESS; } - mq_window_new(argc, argv); + mq_window_new(opt_uris); gtk_main(); diff --git a/src/window.c b/src/window.c index 416acf5..1158b38 100644 --- a/src/window.c +++ b/src/window.c @@ -26,8 +26,7 @@ #include "window.h" MqWindow * -mq_window_new(gint __attribute__((unused)) uri_c, - gchar __attribute__((unused)) *uri_v[]) +mq_window_new(gchar __attribute__((unused)) **uris) { MqWindow *window; diff --git a/src/window.h b/src/window.h index 1b39dbe..f14e5fc 100644 --- a/src/window.h +++ b/src/window.h @@ -23,4 +23,4 @@ typedef struct { GtkWidget *gtk_window; } MqWindow; -MqWindow *mq_window_new(gint uri_c, gchar *uri_v[]); +MqWindow *mq_window_new(gchar **uris); -- cgit v0.9.1