gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36982 - in gnunet/src: include util


From: gnunet
Subject: [GNUnet-SVN] r36982 - in gnunet/src: include util
Date: Thu, 7 Apr 2016 22:54:53 +0200

Author: grothoff
Date: 2016-04-07 22:54:53 +0200 (Thu, 07 Apr 2016)
New Revision: 36982

Modified:
   gnunet/src/include/gnunet_getopt_lib.h
   gnunet/src/include/gnunet_os_lib.h
   gnunet/src/util/getopt_helpers.c
   gnunet/src/util/os_installation.c
Log:
expand GNUNET_OS_ProjectData API to also enable de-duplcation of logic for 
--help

Modified: gnunet/src/include/gnunet_getopt_lib.h
===================================================================
--- gnunet/src/include/gnunet_getopt_lib.h      2016-04-04 15:34:48 UTC (rev 
36981)
+++ gnunet/src/include/gnunet_getopt_lib.h      2016-04-07 20:54:53 UTC (rev 
36982)
@@ -80,6 +80,7 @@
 
 };
 
+
 /**
  * @brief Process a command line option
  *
@@ -89,11 +90,12 @@
  * @param value argument, NULL if none was given
  * @return #GNUNET_OK to continue processing other options, #GNUNET_SYSERR to 
abort
  */
-typedef int (*GNUNET_GETOPT_CommandLineOptionProcessor) (struct
-                                                         
GNUNET_GETOPT_CommandLineProcessorContext *ctx,
-                                                         void *scls,
-                                                         const char *option,
-                                                         const char *value);
+typedef int
+(*GNUNET_GETOPT_CommandLineOptionProcessor) (struct
+                                             
GNUNET_GETOPT_CommandLineProcessorContext *ctx,
+                                             void *scls,
+                                             const char *option,
+                                             const char *value);
 
 /**
  * @brief Definition of a command line option.
@@ -122,7 +124,8 @@
   const char *description;
 
   /**
-   * Is an argument required?  0: #GNUNET_NO (includes optional), 1: 
#GNUNET_YES.
+   * Is an argument required?  #GNUNET_NO (includes optional) or
+   * #GNUNET_YES (required)
    */
   int require_argument;
 

Modified: gnunet/src/include/gnunet_os_lib.h
===================================================================
--- gnunet/src/include/gnunet_os_lib.h  2016-04-04 15:34:48 UTC (rev 36981)
+++ gnunet/src/include/gnunet_os_lib.h  2016-04-07 20:54:53 UTC (rev 36982)
@@ -240,6 +240,16 @@
    */
   const char *env_varname_alt;
 
+  /**
+   * E-mail address for reporting bugs.
+   */
+  const char *bug_email;
+
+  /**
+   * Project homepage.
+   */
+  const char *homepage;
+
 };
 
 
@@ -251,6 +261,13 @@
 
 
 /**
+ * @return current (actual) project data.
+ */
+const struct GNUNET_OS_ProjectData *
+GNUNET_OS_project_data_get (void);
+
+
+/**
  * Setup OS subsystem with project data.
  *
  * @param pd project data used to determine paths.

Modified: gnunet/src/util/getopt_helpers.c
===================================================================
--- gnunet/src/util/getopt_helpers.c    2016-04-04 15:34:48 UTC (rev 36981)
+++ gnunet/src/util/getopt_helpers.c    2016-04-07 20:54:53 UTC (rev 36982)
@@ -82,6 +82,7 @@
   char *scp;
   const char *trans;
   const struct GNUNET_GETOPT_CommandLineOption *opt;
+  const struct GNUNET_OS_ProjectData *pd;
 
   if (NULL != about)
   {
@@ -153,9 +154,12 @@
       printf ("\n");
     i++;
   }
-  printf ("Report bugs to address@hidden"
-          "GNUnet home page: http://www.gnu.org/software/gnunet/\n";
-          "General help using GNU software: http://www.gnu.org/gethelp/\n";);
+  pd = GNUNET_OS_project_data_get ();
+  printf ("Report bugs to %s.\n"
+          "GNUnet home page: %s\n"
+          "General help using GNU software: http://www.gnu.org/gethelp/\n";,
+          pd->bug_email,
+          pd->homepage);
   return GNUNET_NO;
 }
 

Modified: gnunet/src/util/os_installation.c
===================================================================
--- gnunet/src/util/os_installation.c   2016-04-04 15:34:48 UTC (rev 36981)
+++ gnunet/src/util/os_installation.c   2016-04-07 20:54:53 UTC (rev 36982)
@@ -58,6 +58,8 @@
   .project_dirname = "gnunet",
   .binary_name = "gnunet-arm",
   .env_varname = "GNUNET_PREFIX",
+  .bug_email = "address@hidden",
+  .homepage = "http://www.gnu.org/s/gnunet/";,
 };
 
 /**
@@ -77,6 +79,16 @@
 
 
 /**
+ * @return current project data.
+ */
+const struct GNUNET_OS_ProjectData *
+GNUNET_OS_project_data_get ()
+{
+  return current_pd;
+}
+
+
+/**
  * Setup OS subsystem with project data.
  *
  * @param pd project data used to determine paths




reply via email to

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