aboutsummaryrefslogtreecommitdiff
path: root/src/common/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/helper.c')
-rw-r--r--src/common/helper.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/helper.c b/src/common/helper.c
index 2a23799b..64a01a23 100644
--- a/src/common/helper.c
+++ b/src/common/helper.c
@@ -27,6 +27,7 @@
27#include "platform.h" 27#include "platform.h"
28#include "gnunetgtk_common.h" 28#include "gnunetgtk_common.h"
29#include <GNUnet/gnunet_util_crypto.h> 29#include <GNUnet/gnunet_util_crypto.h>
30#include <GNUnet/gnunet_util_cron.h>
30#include <glib.h> 31#include <glib.h>
31#include <gmodule.h> 32#include <gmodule.h>
32 33
@@ -83,6 +84,12 @@ static struct GE_Context * ectx;
83 84
84static struct GC_Configuration * cfg; 85static struct GC_Configuration * cfg;
85 86
87static struct CronManager * cron;
88
89struct CronManager * gnunet_gtk_get_cron() {
90 return cron;
91}
92
86static gboolean saveCallWrapper(gpointer data) { 93static gboolean saveCallWrapper(gpointer data) {
87 SaveCall * call = data; 94 SaveCall * call = data;
88 int i; 95 int i;
@@ -293,6 +300,7 @@ void initGNUnetGTKCommon(struct GE_Context * e,
293 sclock = MUTEX_CREATE(YES); 300 sclock = MUTEX_CREATE(YES);
294 mainThread = PTHREAD_GET_SELF(); 301 mainThread = PTHREAD_GET_SELF();
295 saveCallsUp = YES; 302 saveCallsUp = YES;
303 cron = cron_create(ectx);
296 304
297 /* load the interface */ 305 /* load the interface */
298 path = os_get_installation_path(IPK_DATADIR); 306 path = os_get_installation_path(IPK_DATADIR);
@@ -326,11 +334,13 @@ void initGNUnetGTKCommon(struct GE_Context * e,
326 loadPlugins(load); 334 loadPlugins(load);
327 FREE(load); 335 FREE(load);
328 connectGladeWithPlugins(mainXML); 336 connectGladeWithPlugins(mainXML);
337 cron_start(cron);
329} 338}
330 339
331void shutdownPlugins() { 340void shutdownPlugins() {
332 int i; 341 int i;
333 342
343 cron_stop(cron);
334 /* unload the plugins */ 344 /* unload the plugins */
335 while (plugin != NULL) { 345 while (plugin != NULL) {
336 Plugin * next; 346 Plugin * next;
@@ -362,6 +372,7 @@ void shutdownPlugins() {
362} 372}
363 373
364void doneGNUnetGTKCommon() { 374void doneGNUnetGTKCommon() {
375 cron_destroy(cron);
365 PTHREAD_REL_SELF(mainThread); 376 PTHREAD_REL_SELF(mainThread);
366 MUTEX_DESTROY(sclock); 377 MUTEX_DESTROY(sclock);
367} 378}