aboutsummaryrefslogtreecommitdiff
path: root/src/lib/eventloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eventloop.c')
-rw-r--r--src/lib/eventloop.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c
index cc0ab120..2ba01101 100644
--- a/src/lib/eventloop.c
+++ b/src/lib/eventloop.c
@@ -87,6 +87,11 @@ struct GNUNET_GTK_MainLoop
87 GPollFD *cached_poll_array; 87 GPollFD *cached_poll_array;
88 88
89 /** 89 /**
90 * Name of the configuration file.
91 */
92 char *cfgfile;
93
94 /**
90 * Size of the 'cached_poll_array'. 95 * Size of the 'cached_poll_array'.
91 */ 96 */
92 guint cached_poll_array_size; 97 guint cached_poll_array_size;
@@ -188,6 +193,19 @@ GNUNET_GTK_main_loop_quit (struct GNUNET_GTK_MainLoop *ml)
188 193
189 194
190/** 195/**
196 * Obtain the name of the configuration file that is being used.
197 *
198 * @param ml handle to the main loop
199 * @return name of configuration file
200 */
201const char *
202GNUNET_GTK_main_loop_get_configuration_file (struct GNUNET_GTK_MainLoop *ml)
203{
204 return ml->cfgfile;
205}
206
207
208/**
191 * Get an object from the main window. 209 * Get an object from the main window.
192 * 210 *
193 * @param ml handle to the main loop 211 * @param ml handle to the main loop
@@ -816,7 +834,7 @@ gnunet_gtk_select (void *cls, struct GNUNET_NETWORK_FDSet *rfds,
816 */ 834 */
817static void 835static void
818run_main_loop (void *cls, char *const *args, const char *cfgfile, 836run_main_loop (void *cls, char *const *args, const char *cfgfile,
819 const struct GNUNET_CONFIGURATION_Handle *cfg) 837 const struct GNUNET_CONFIGURATION_Handle *cfg)
820{ 838{
821 struct GNUNET_GTK_MainLoop *ml = cls; 839 struct GNUNET_GTK_MainLoop *ml = cls;
822 int argc; 840 int argc;
@@ -836,6 +854,7 @@ run_main_loop (void *cls, char *const *args, const char *cfgfile,
836 ml->gml = g_main_loop_new (NULL, TRUE); 854 ml->gml = g_main_loop_new (NULL, TRUE);
837 ml->gmc = g_main_loop_get_context (ml->gml); 855 ml->gmc = g_main_loop_get_context (ml->gml);
838 ml->cfg = cfg; 856 ml->cfg = cfg;
857 ml->cfgfile = GNUNET_strdup (cfgfile);
839#if WINDOWS 858#if WINDOWS
840 ml->hEventRead = CreateEvent (NULL, TRUE, FALSE, NULL); 859 ml->hEventRead = CreateEvent (NULL, TRUE, FALSE, NULL);
841 ml->hEventReadReady = CreateEvent (NULL, TRUE, TRUE, NULL); 860 ml->hEventReadReady = CreateEvent (NULL, TRUE, TRUE, NULL);
@@ -891,8 +910,8 @@ GNUNET_GTK_main_loop_start (const char *binary_name, const char *binary_help,
891 ml.main_window_file = main_window_file; 910 ml.main_window_file = main_window_file;
892 ml.main_task = main_task; 911 ml.main_task = main_task;
893 ret = 912 ret =
894 GNUNET_PROGRAM_run (argc, argv, binary_name, "GTK GUI for GNUnet", 913 GNUNET_PROGRAM_run (argc, argv, binary_name, binary_help,
895 options, &run_main_loop, &ml); 914 options, &run_main_loop, &ml);
896 if (NULL != ml.cached_poll_array) 915 if (NULL != ml.cached_poll_array)
897 g_free (ml.cached_poll_array); 916 g_free (ml.cached_poll_array);
898 if (NULL != ml.rs) 917 if (NULL != ml.rs)
@@ -903,6 +922,7 @@ GNUNET_GTK_main_loop_start (const char *binary_name, const char *binary_help,
903 g_object_unref (G_OBJECT (ml.builder)); 922 g_object_unref (G_OBJECT (ml.builder));
904 if (NULL != ml.gml) 923 if (NULL != ml.gml)
905 g_main_loop_unref (ml.gml); 924 g_main_loop_unref (ml.gml);
925 GNUNET_free_non_null (ml.cfgfile);
906 return ret; 926 return ret;
907} 927}
908 928