gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25164 - gnunet/src/consensus


From: gnunet
Subject: [GNUnet-SVN] r25164 - gnunet/src/consensus
Date: Thu, 29 Nov 2012 15:24:14 +0100

Author: grothoff
Date: 2012-11-29 15:24:13 +0100 (Thu, 29 Nov 2012)
New Revision: 25164

Modified:
   gnunet/src/consensus/Makefile.am
   gnunet/src/consensus/consensus.h
   gnunet/src/consensus/gnunet-consensus.c
Log:
-you are welcome

Modified: gnunet/src/consensus/Makefile.am
===================================================================
--- gnunet/src/consensus/Makefile.am    2012-11-29 14:04:08 UTC (rev 25163)
+++ gnunet/src/consensus/Makefile.am    2012-11-29 14:24:13 UTC (rev 25164)
@@ -28,6 +28,7 @@
  gnunet-consensus.c         
 gnunet_consensus_LDADD = \
   $(top_builddir)/src/util/libgnunetutil.la \
+  $(top_builddir)/src/consensus/libgnunetconsensus.la \
   $(GN_LIBINTL)
 
 gnunet_service_consensus_SOURCES = \

Modified: gnunet/src/consensus/consensus.h
===================================================================
--- gnunet/src/consensus/consensus.h    2012-11-29 14:04:08 UTC (rev 25163)
+++ gnunet/src/consensus/consensus.h    2012-11-29 14:24:13 UTC (rev 25164)
@@ -23,8 +23,8 @@
  * @file consensus/consensus.h
  * @brief
  */
-#ifndef NSE_H
-#define NSE_H
+#ifndef CONSENSUS_H
+#define CONSENSUS_H
 
 #include "gnunet_common.h"
 

Modified: gnunet/src/consensus/gnunet-consensus.c
===================================================================
--- gnunet/src/consensus/gnunet-consensus.c     2012-11-29 14:04:08 UTC (rev 
25163)
+++ gnunet/src/consensus/gnunet-consensus.c     2012-11-29 14:24:13 UTC (rev 
25164)
@@ -23,13 +23,58 @@
  * @brief 
  * @author Florian Dold
  */
+#include "platform.h"
+#include "gnunet_util_lib.h"
+#include "gnunet_consensus_service.h"
 
 
-#include "gnunet_consensus_service.h"
 
 
+/**
+ * Called when a new element was received from another peer, or an error 
occured.
+ *
+ * May deliver duplicate values.
+ *
+ * Elements given to a consensus operation by the local peer are NOT given
+ * to this callback.
+ *
+ * @param cls closure
+ * @param element new element, NULL on error
+ * @return GNUNET_OK if the valid is well-formed and should be added to the 
consensus,
+ *         GNUNET_SYSERR if the element should be ignored and not be propagated
+ */
+static int
+cb (void *cls,
+    struct GNUNET_CONSENSUS_Element *element)
+{
+  return 0;
+}
+
+
+
+static void
+run (void *cls, char *const *args, const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+  static struct GNUNET_PeerIdentity pid;
+  static struct GNUNET_HashCode sid;
+  
+  GNUNET_CONSENSUS_create (cfg,
+                          1, &pid,
+                          &sid,
+                          &cb, NULL);
+  
+}
+
+
 int
-main ()
+main (int argc, char **argv)
 {
+   static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+        GNUNET_GETOPT_OPTION_END
+   };
+  GNUNET_PROGRAM_run (argc, argv, "gnunet-consensus",
+                     "help",
+                     options, &run, NULL);
   return 0;
 }




reply via email to

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