aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
authordold <dold@140774ce-b5e7-0310-ab8b-a85725594a96>2012-11-15 10:44:47 +0000
committerdold <dold@140774ce-b5e7-0310-ab8b-a85725594a96>2012-11-15 10:44:47 +0000
commit37ab180c91a799856eff2ddbdcb36f1dc194eaff (patch)
treecde9bd82034a24bc92c617a542d2a2afbfc23cec /src/consensus
parent181609b929f5270530d4cc807ba16a7c1656136f (diff)
added declarations for the consensus api
git-svn-id: https://gnunet.org/svn/gnunet@24978 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/Makefile.am14
-rw-r--r--src/consensus/gnunet-consensus.c35
-rw-r--r--src/consensus/gnunet-service-consensus.cc56
3 files changed, 95 insertions, 10 deletions
diff --git a/src/consensus/Makefile.am b/src/consensus/Makefile.am
index 2041ec1acd..5929a4d977 100644
--- a/src/consensus/Makefile.am
+++ b/src/consensus/Makefile.am
@@ -15,17 +15,17 @@ if USE_COVERAGE
AM_CFLAGS = -fprofile-arcs -ftest-coverage
endif
-#bin_PROGRAMS = \
-# gnunet-consensus
+bin_PROGRAMS = \
+ gnunet-consensus
libexec_PROGRAMS = \
gnunet-service-consensus
-#gnunet_consensus_SOURCES = \
-# gnunet-consensus.c
-#gnunet_consensus_LDADD = \
-# $(top_builddir)/src/util/libgnunetutil.la \
-# $(GN_LIBINTL)
+gnunet_consensus_SOURCES = \
+ gnunet-consensus.c
+gnunet_consensus_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(GN_LIBINTL)
gnunet_service_consensus_SOURCES = \
gnunet-service-consensus.cc
diff --git a/src/consensus/gnunet-consensus.c b/src/consensus/gnunet-consensus.c
new file mode 100644
index 0000000000..b2b6350590
--- /dev/null
+++ b/src/consensus/gnunet-consensus.c
@@ -0,0 +1,35 @@
+/*
+ This file is part of GNUnet
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * @file consensus/gnunet-consensus.c
+ * @brief
+ * @author Florian Dold
+ */
+
+
+#include "gnunet_consensus_service.h"
+
+
+int
+main ()
+{
+ return 0;
+}
diff --git a/src/consensus/gnunet-service-consensus.cc b/src/consensus/gnunet-service-consensus.cc
index d5e829e513..82ea5ef790 100644
--- a/src/consensus/gnunet-service-consensus.cc
+++ b/src/consensus/gnunet-service-consensus.cc
@@ -1,10 +1,60 @@
+/*
+ This file is part of GNUnet
+ (C) 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 2, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+ */
+
+
#include <cstdio>
#include <iostream>
+#include <stdint.h>
+
+#include "platform.h"
+#include "gnunet_common.h"
+#include "gnunet_service_lib.h"
using namespace std;
-int main ()
+/**
+ * Process statistics requests.
+ *
+ * @param cls closure
+ * @param server the initialized server
+ * @param c configuration to use
+ */
+static void
+run (void *cls, struct GNUNET_SERVER_Handle *server,
+ const struct GNUNET_CONFIGURATION_Handle *c)
{
- cout << "Hello world" << endl;
- return 0;
+ /* TODO */
}
+
+
+/**
+ * The main function for the statistics service.
+ *
+ * @param argc number of arguments from the command line
+ * @param argv command line arguments
+ * @return 0 ok, 1 on error
+ */
+int
+main (int argc, char *const *argv)
+{
+ return (GNUNET_OK ==
+ GNUNET_SERVICE_run (argc, argv, "statistics", GNUNET_SERVICE_OPTION_NONE, &run, NULL)) ? 0 : 1;
+}
+