gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3539 - in gnunet-gtk/src: common core include


From: grothoff
Subject: [GNUnet-SVN] r3539 - in gnunet-gtk/src: common core include
Date: Sat, 21 Oct 2006 19:39:20 -0700 (PDT)

Author: grothoff
Date: 2006-10-21 19:39:16 -0700 (Sat, 21 Oct 2006)
New Revision: 3539

Modified:
   gnunet-gtk/src/common/Makefile.am
   gnunet-gtk/src/core/Makefile.am
   gnunet-gtk/src/core/main.c
   gnunet-gtk/src/include/gnunetgtk_common.h
Log:
compiling core

Modified: gnunet-gtk/src/common/Makefile.am
===================================================================
--- gnunet-gtk/src/common/Makefile.am   2006-10-22 02:28:55 UTC (rev 3538)
+++ gnunet-gtk/src/common/Makefile.am   2006-10-22 02:39:16 UTC (rev 3539)
@@ -20,6 +20,7 @@
   @GNUNETGTK_LIBS@ \
   $(INTLLIBS) \
   -lgnunetutil \
+  -lgnunetutil_crypto \
   -lgthread-2.0 \
   $(LIBNOTIFY_LIBS)
 

Modified: gnunet-gtk/src/core/Makefile.am
===================================================================
--- gnunet-gtk/src/core/Makefile.am     2006-10-22 02:28:55 UTC (rev 3538)
+++ gnunet-gtk/src/core/Makefile.am     2006-10-22 02:39:16 UTC (rev 3539)
@@ -18,6 +18,7 @@
 gnunet_gtk_LDADD = \
   @GTK_LIBS@ \
   -lgnunetutil \
+  -lgnunetutil_boot \
   $(INTLLIBS) \
   -lgthread-2.0 \
   $(top_builddir)/src/common/libgnunetgtk_common.la \

Modified: gnunet-gtk/src/core/main.c
===================================================================
--- gnunet-gtk/src/core/main.c  2006-10-22 02:28:55 UTC (rev 3538)
+++ gnunet-gtk/src/core/main.c  2006-10-22 02:39:16 UTC (rev 3539)
@@ -26,6 +26,8 @@
 
 #include "platform.h"
 #include "gnunetgtk_common.h"
+#include <GNUnet/gnunet_directories.h>
+#include <GNUnet/gnunet_util_boot.h>
 #include "eggtrayicon.h"
 
 #ifdef WINDOWS
@@ -34,6 +36,7 @@
 static int debug_mode = NO;
 #endif
 
+static char * cfgFilename = DEFAULT_CLIENT_CONFIG_FILE;
 
 /**
  * All gnunet-gtk command line options
@@ -54,25 +57,29 @@
 };
 
 static void * shutdownCode(void * unused) {
-  stopCron();
   shutdownPlugins();
   return NULL;
 }
 
 void gnunet_gtk_main_quit() {
-  setCustomLogProc(NULL);
+  GE_setDefaultContext(NULL);
   run_with_save_calls(&shutdownCode,
                      NULL);
   gtk_main_quit();
 }
 
+#if 0
 static void customLog(const char * msg) {
   addLogEntry("%s", msg);
 }
+#endif
 
 int main(int argc,
-        char *argv[]) {
+        char * argv[]) {
   GtkWidget * root;
+  int i;
+  struct GE_Context * ectx;
+  struct GC_Configuration * cfg;
 
 #ifdef WINDOWS
   SetCursor(LoadCursor(NULL, IDC_APPSTARTING));
@@ -80,22 +87,15 @@
 
   g_thread_init(NULL);
   gtk_init(&argc, &argv);
-  ectx = GE_create_context_stderr(NO, 
-                                 GE_WARNING | GE_ERROR | GE_FATAL |
-                                 GE_USER | GE_ADMIN | GE_DEVELOPER |
-                                 GE_IMMEDIATE | GE_BULK);
-  GE_setDefaultContext(ectx);
-  cfg = GC_create_C_impl();
-  GE_ASSERT(ectx, cfg != NULL);
-  i = gnunet_parse_options("gnunet-insert [OPTIONS] FILENAME",
-                          ectx,
-                          cfg,
-                          gnunetinsertOptions,
-                          (unsigned int) argc,
-                          argv);
-  if (i == SYSERR) {
-    GC_free(cfg);
-    GE_free_context(ectx);
+  i = GNUNET_init(argc,
+                 (const char**) argv,
+                 "gnunet-gtk",
+                 &cfgFilename,
+                 gnunetgtkOptions,
+                 &ectx,
+                 &cfg);
+  if (i == -1) {
+    GNUNET_fini(ectx, cfg);
     return -1;  
   }
 
@@ -110,7 +110,9 @@
   bind_textdomain_codeset("GNUnet", "UTF-8");
   bind_textdomain_codeset("gnunet-gtk", "UTF-8");
 #endif
-  initGNUnetGTKCommon(&gnunet_gtk_main_quit);
+  initGNUnetGTKCommon(ectx,
+                     cfg,
+                     &gnunet_gtk_main_quit);
   root
     = glade_xml_get_widget(getMainXML(),
                           "mainWindow");
@@ -119,7 +121,7 @@
   initTrayIcon();
 #endif
   gtk_widget_show(root);
-  setCustomLogProc(&customLog);
+  //  GE_setDefaultContext(customLog);
   /* start the event loop */
   gdk_threads_enter();
 
@@ -130,6 +132,7 @@
   gtk_main();
   gdk_threads_leave();
   doneGNUnetGTKCommon();
+  GNUNET_fini(ectx, cfg);
   return 0;
 }
 

Modified: gnunet-gtk/src/include/gnunetgtk_common.h
===================================================================
--- gnunet-gtk/src/include/gnunetgtk_common.h   2006-10-22 02:28:55 UTC (rev 
3538)
+++ gnunet-gtk/src/include/gnunetgtk_common.h   2006-10-22 02:39:16 UTC (rev 
3539)
@@ -43,7 +43,9 @@
 #include "datadir.h"
 #endif
 
-void initGNUnetGTKCommon(void * callback);
+void initGNUnetGTKCommon(struct GE_Context * ectx,
+                        struct GC_Configuration * cfg,
+                        void * callback);
 
 void shutdownPlugins(void);
 





reply via email to

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