gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25756 - in gnunet-update/src: . fs


From: gnunet
Subject: [GNUnet-SVN] r25756 - in gnunet-update/src: . fs
Date: Fri, 11 Jan 2013 14:37:15 +0100

Author: harsha
Date: 2013-01-11 14:37:15 +0100 (Fri, 11 Jan 2013)
New Revision: 25756

Added:
   gnunet-update/src/fs/
   gnunet-update/src/fs/Makefile.am
   gnunet-update/src/fs/gnupdate-daemon-search.c
Log:
- skeleton

Index: gnunet-update/src/fs
===================================================================
--- gnunet-update/src/fs        2013-01-11 13:18:34 UTC (rev 25755)
+++ gnunet-update/src/fs        2013-01-11 13:37:15 UTC (rev 25756)

Property changes on: gnunet-update/src/fs
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+.deps
+gnupdate-daemon-search
+Makefile
+Makefile.in
Added: gnunet-update/src/fs/Makefile.am
===================================================================
--- gnunet-update/src/fs/Makefile.am                            (rev 0)
+++ gnunet-update/src/fs/Makefile.am    2013-01-11 13:37:15 UTC (rev 25756)
@@ -0,0 +1,25 @@
+SUBDIRS = .
+
+INCLUDES = \
+  -I$(top_srcdir)/src/include \
+  -I$(top_srcdir)
+
+AM_CPPFLAGS = \
+  $(GNUNET_CPPFLAGS)
+
+# Set this variable if you are using GNUNET libraries for all programs and
+# libraries. You don't then need to target-specific _LDFLAGS with 
GNUNET_LDFLAGS
+
+AM_LDFLAGS = \
+  $(GNUNET_LDFLAGS) \
+  $(WINFLAGS) \
+  -export-dynamic
+
+bin_PROGRAMS = gnupdate-daemon-search
+
+gnupdate_daemon_search_SOURCES = \
+  gnupdate-daemon-search.c
+gnupdate_daemon_search_LDADD = \
+  -lgnunetutil -lgnunetfs\
+  $(INTLLIBS) 
+

Added: gnunet-update/src/fs/gnupdate-daemon-search.c
===================================================================
--- gnunet-update/src/fs/gnupdate-daemon-search.c                               
(rev 0)
+++ gnunet-update/src/fs/gnupdate-daemon-search.c       2013-01-11 13:37:15 UTC 
(rev 25756)
@@ -0,0 +1,88 @@
+/*
+     This file is part of GNUnet.
+     (C) 2003, 2004, 2005, 2006, 2007, 2008, 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 src/fs/gnupdate-daemon-search.c
+ * @brief Daemon for searching new gnunet-update metadata files
+ * @author Sree Harsha Totakura <address@hidden> 
+ */
+
+#include <gnunet/platform.h>
+#include <gnunet/gnunet_util_lib.h>
+#include <gnunet/gnunet_fs_service.h>
+
+
+/**
+ * Return status of the program
+ */
+int ret;
+
+
+/**
+ * Main function that will be run by the scheduler.
+ *
+ * @param cls closure
+ * @param args remaining command-line arguments
+ * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
+ * @param c configuration
+ */
+static void
+run (void *cls, char *const *args, const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *c)
+{
+  //char **keywords;
+  char *path;
+  
+  path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
+  printf ("DATA dir: %s\n", path);
+  GNUNET_free (path);
+  path = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_SELF_PREFIX);
+  printf ("SELF dir: %s\n", path);
+  GNUNET_free (path);
+  ret = 0;
+  return;
+}
+
+
+/**
+ * The main function to search GNUnet.
+ *
+ * @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)
+{
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    GNUNET_GETOPT_OPTION_END
+  };
+  
+  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
+    return 2;
+
+  ret = (GNUNET_OK ==
+        GNUNET_PROGRAM_run (argc, argv, "gnupdate-daemon-search",
+                            gettext_noop
+                            ("Search new gnunet-update metadata files in 
GNUnet FS network"),
+                            options, &run, NULL)) ? ret : 1;
+  GNUNET_free ((void*) argv);
+  return ret;
+}




reply via email to

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