gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3541 - in gnunet-gtk/src: common plugins/daemon


From: grothoff
Subject: [GNUnet-SVN] r3541 - in gnunet-gtk/src: common plugins/daemon
Date: Sat, 21 Oct 2006 19:47:09 -0700 (PDT)

Author: grothoff
Date: 2006-10-21 19:47:07 -0700 (Sat, 21 Oct 2006)
New Revision: 3541

Modified:
   gnunet-gtk/src/common/helper.c
   gnunet-gtk/src/plugins/daemon/daemon.c
Log:
making daemon compile

Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c      2006-10-22 02:41:49 UTC (rev 3540)
+++ gnunet-gtk/src/common/helper.c      2006-10-22 02:47:07 UTC (rev 3541)
@@ -85,6 +85,8 @@
 
 static struct GE_Context * ectx;
 
+static struct GC_Configuration * cfg;
+
 #ifdef WINDOWS
 static void CALLBACK sigalrmHandler(DWORD sig) {
 }
@@ -300,12 +302,15 @@
                                    xml);
 }
 
+typedef void (*InitCall)(struct GE_Context * ectx,
+                        struct GC_Configuration * cfg);
+
 typedef void (*PlainCall)(void);
 
 static void loadPlugin(const char * name) {
   Plugin * p;
   struct PluginHandle * lib;
-  PlainCall init;
+  InitCall init;
 
   lib = os_plugin_load(ectx,
                       "libgnunetgtkmodule_",
@@ -321,7 +326,7 @@
                                    "init_",
                                    NO);
   if (init != NULL)
-    init();
+    init(ectx, cfg);
 }
 
 static void loadPlugins(const char * names) {
@@ -367,11 +372,12 @@
 }
 
 void initGNUnetGTKCommon(struct GE_Context * e,
-                        struct GC_Configuration * cfg,
+                        struct GC_Configuration * c,
                         void * callback) {
   char * load;
 
   ectx = e;
+  cfg = c;
   shutdown_function = callback;
   sclock = MUTEX_CREATE(YES);
   mainThread = PTHREAD_GET_SELF();

Modified: gnunet-gtk/src/plugins/daemon/daemon.c
===================================================================
--- gnunet-gtk/src/plugins/daemon/daemon.c      2006-10-22 02:41:49 UTC (rev 
3540)
+++ gnunet-gtk/src/plugins/daemon/daemon.c      2006-10-22 02:47:07 UTC (rev 
3541)
@@ -28,11 +28,15 @@
 #include "gnunetgtk_common.h"
 #include <GNUnet/gnunet_getoption_lib.h>
 #include <GNUnet/gnunet_util_cron.h>
-#include <GNUnet/gnunet_network_client.h>
+#include <GNUnet/gnunet_util_network_client.h>
 #include <gtk/gtk.h>
 
+static struct CronManager * cron;
 
+static struct GE_Context * ectx;
 
+static struct GC_Configuration * cfg;
+
 /**
  * cron job that periodically updates the model for the
  * application list.
@@ -170,8 +174,8 @@
 /**
  * Launch gnunetd w/ checks
  */
-void on_startDaemon_clicked(GtkWidget * widget,
-                           gpointer data) {
+void on_startDaemon_clicked_daemon(GtkWidget * widget,
+                                  gpointer data) {
   GtkWidget * launchEntry;
 
   launchEntry
@@ -198,9 +202,11 @@
 /**
  * Kill gnunetd
  */
-void on_stopDaemon_clicked(GtkWidget * widget,
-                          gpointer data) {
+void on_stopDaemon_clicked_daemon(GtkWidget * widget,
+                                 gpointer data) {
   GtkWidget * killEntry = NULL;
+  struct ClientServerConnection * sock;
+
   killEntry
     = glade_xml_get_widget(getMainXML(),
                           "stopDaemon");
@@ -229,13 +235,16 @@
   cronCheckDaemon(NULL);
 }
 
-void init_daemon() {
+void init_daemon(struct GE_Context * e,
+                struct GC_Configuration * c) {
   GtkWidget * tab;
   GtkWidget * apps;
   GtkListStore * model;
   GtkCellRenderer * renderer;
   int col;
 
+  ectx = e;
+  cfg = c;
   apps
     = glade_xml_get_widget(getMainXML(),
                           "applicationList");
@@ -268,6 +277,7 @@
     = glade_xml_get_widget(getMainXML(),
                           "daemonScrolledWindow");
   gtk_widget_show(tab);
+  cron = cron_create(ectx);
   cron_add_job(cron,
               &cronCheckDaemon,
               0,
@@ -278,9 +288,11 @@
               5 * cronMINUTES,
               5 * cronMINUTES,
               NULL);
+  cron_start(cron);
 }
 
 void done_daemon() {
+  cron_stop(cron);
   cron_del_job(cron,
               &cronCheckDaemon,
               15 * cronSECONDS,
@@ -289,6 +301,7 @@
               &updateAppModel,
               5 * cronMINUTES,
               NULL);
+  cron_destroy(cron);
 }
 
 /**





reply via email to

[Prev in Thread] Current Thread [Next in Thread]