endif
-#lib_LTLIBRARIES = \
-# libgnunetnamestore.la
-#
-#libgnunetnamestore_la_SOURCES = \
-# namestore_api.c namestore.h
-#libgnunetnamestore_la_LIBADD = \
-# $(top_builddir)/src/statistics/libgnunetstatistics.la \
-# $(top_builddir)/src/util/libgnunetutil.la \
-# $(GN_LIBINTL)
-#libgnunetnamestore_la_LDFLAGS = \
-# $(GN_LIB_LDFLAGS) $(WINFLAGS) \
-# -version-info 0:0:0
-#
-
-#bin_PROGRAMS = \
-# gnunet-service-namestore
-#
-#gnunet_service_namestore_SOURCES = \
-# gnunet-service-namestore.c
-#gnunet_service_namestore_LDADD = \
-# $(top_builddir)/src/statistics/libgnunetstatistics.la \
-# $(top_builddir)/src/util/libgnunetutil.la \
-# $(GN_LIBINTL)
+check_PROGRAMS = \
+ test_namestore_api
+
+lib_LTLIBRARIES = \
+ libgnunetnamestore.la
+
+libgnunetnamestore_la_SOURCES = \
+ namestore_api.c namestore.h
+libgnunetnamestore_la_LIBADD = \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(GN_LIBINTL)
+libgnunetnamestore_la_LDFLAGS = \
+ $(GN_LIB_LDFLAGS) $(WINFLAGS) \
+ -version-info 0:0:0
+
+bin_PROGRAMS = \
+ gnunet-service-namestore
+
+gnunet_service_namestore_SOURCES = \
+ gnunet-service-namestore.c
+gnunet_service_namestore_LDADD = \
+ $(top_builddir)/src/statistics/libgnunetstatistics.la \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(GN_LIBINTL)
if HAVE_SQLITE
SQLITE_PLUGIN = libgnunet_plugin_namestore_sqlite.la
libgnunet_plugin_namestore_sqlite_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
+
+test_namestore_api_SOURCES = \
+ test_namestore_api.c
+test_namestore_api_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/namestore/libgnunetnamestore.la
+
+EXTRADIST = \
+ test_namestore_api.conf
+
+
\ No newline at end of file
#include "gnunet_service_lib.h"
#include "gnunet_namestore_service.h"
+
/**
* Task run during shutdown.
*
/* FIXME: add handlers here! */
{NULL, NULL, 0, 0}
};
- /* FIXME: do setup here */
+
GNUNET_SERVER_add_handlers (server, handlers);
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task,
NULL);
--- /dev/null
+/*
+ This file is part of GNUnet.
+ (C) 2009 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 3, 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 namestore/test_namestore_api.c
+ * @brief testcase for namestore_api.c
+ */
+#include "platform.h"
+#include "gnunet_common.h"
+#include "gnunet_namestore_service.h"
+
+#define VERBOSE GNUNET_EXTRA_LOGGING
+
+static int res;
+
+static void
+run (void *cls, char *const *args, const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
+{
+
+ res = 0;
+}
+
+static int
+check ()
+{
+ static char *const argv[] = { "test-namestore-api",
+ "-c",
+ "test_namestore_api.conf",
+#if VERBOSE
+ "-L", "DEBUG",
+#endif
+ NULL
+ };
+ static struct GNUNET_GETOPT_CommandLineOption options[] = {
+ GNUNET_GETOPT_OPTION_END
+ };
+
+ res = 1;
+ GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "test-namestore-api",
+ "nohelp", options, &run, &res);
+ return res;
+}
+
+int
+main (int argc, char *argv[])
+{
+ int ret;
+
+
+ ret = check ();
+
+ return ret;
+}
+
+/* end of test_namestore_api.c */
--- /dev/null
+[namestore]
+AUTOSTART = YES
+UNIXPATH = /tmp/gnunet-service-namestore.sock
+UNIX_MATCH_UID = YES
+UNIX_MATCH_GID = YES
+# PORT = 2099
+HOSTNAME = localhost
+HOME = $SERVICEHOME
+CONFIG = $DEFAULTCONFIG
+BINARY = gnunet-service-namestore
+ACCEPT_FROM = 127.0.0.1;
+ACCEPT_FROM6 = ::1;
+DATABASE = sqlite
+
+[namestore-sqlite]
+FILENAME = $SERVICEHOME/namestore/sqlite.db
+
+[namestore-postgres]
+CONFIG = connect_timeout=10; dbname=gnunet
+
+[namestore-mysql]
+DATABASE = gnunet
+CONFIG = ~/.my.cnf
+# USER = gnunet
+# PASSWORD =
+# HOST = localhost
+# PORT = 3306
+
+
+