(I forgot to mention that I'm not subscribed to the list, so I didn't receive the message... Sorry, my bad.)
>I propose we add an "int is_gnu;" member to the struct, and only print >that message in --help if 'is_gnu' is set. Are the attached patches acceptable? I'm not sure if the ProjectData struct should be initialized for gnunet-ext-service too, though. A.V.
>From e0b0bd62037f4d40eb370e4dcfd96d70503508e7 Mon Sep 17 00:00:00 2001 From: Alessio Vanni <[email protected]> Date: Thu, 8 Aug 2019 16:27:28 +0200 Subject: [PATCH] Print help on GNU software only when project is GNU software --- src/include/gnunet_os_lib.h | 5 +++++ src/util/getopt_helpers.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index 41c75e513..d43711a99 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h @@ -271,6 +271,11 @@ struct GNUNET_OS_ProjectData * String identifying the current project version. */ const char *version; + + /** + * Non-zero means this project is part of GNU. + */ + int is_gnu; }; diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c index 05856beee..80d1037bb 100644 --- a/src/util/getopt_helpers.c +++ b/src/util/getopt_helpers.c @@ -178,10 +178,13 @@ format_help (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, } 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", + "Home page: %s\n", pd->bug_email, pd->homepage); + + if (0 != pd->is_gnu) + printf ("General help using GNU software: http://www.gnu.org/gethelp/\n"); + return GNUNET_NO; } -- 2.21.0
>From bc4dc3be1f71d7f8022cd268daa15627d59fb9fa Mon Sep 17 00:00:00 2001 From: Alessio Vanni <[email protected]> Date: Thu, 8 Aug 2019 16:31:06 +0200 Subject: [PATCH] gnunet-ext is part of GNU Also remove platform.h from the service. --- src/ext/gnunet-ext.c | 26 ++++++++++++++------------ src/ext/gnunet-service-ext.c | 12 +++++++++++- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/ext/gnunet-ext.c b/src/ext/gnunet-ext.c index 0df3fe7..f18e351 100644 --- a/src/ext/gnunet-ext.c +++ b/src/ext/gnunet-ext.c @@ -43,18 +43,20 @@ static int ret; /** * This structure holds informations about the project. */ -static const struct GNUNET_OS_ProjectData gnunetext_pd = { - .libname = "libgnunetext", - .project_dirname = "gnunet-ext", - .binary_name = "gnunet-ext", - .env_varname = "GNUNET_EXT_PREFIX", - .base_config_varname = "GNUNET_EXT_BASE_CONFIG", - .bug_email = "[email protected]", - .homepage = "http://www.gnu.org/s/gnunet/", - .config_file = "gnunet-ext.conf", - .user_config_file = "~/.config/gnunet-ext.conf", - .version = "1.0", -}; +static const struct GNUNET_OS_ProjectData gnunetext_pd = + { + .libname = "libgnunetext", + .project_dirname = "gnunet-ext", + .binary_name = "gnunet-ext", + .env_varname = "GNUNET_EXT_PREFIX", + .base_config_varname = "GNUNET_EXT_BASE_CONFIG", + .bug_email = "[email protected]", + .homepage = "http://www.gnu.org/s/gnunet/", + .config_file = "gnunet-ext.conf", + .user_config_file = "~/.config/gnunet-ext.conf", + .version = "1.0", + .is_gnu = 1, + }; /** * Main function that will be run by the scheduler. diff --git a/src/ext/gnunet-service-ext.c b/src/ext/gnunet-service-ext.c index d292eac..aa43933 100644 --- a/src/ext/gnunet-service-ext.c +++ b/src/ext/gnunet-service-ext.c @@ -23,7 +23,17 @@ * @brief ext service implementation * @author Christian Grothoff */ -#include <gnunet/platform.h> +#include "gnunet_ext_config.h" +#include <stddef.h> + +#if WINDOWS +#define FDTYPE HANDLE +#define SOCKTYPE SOCKET +#else +#define FDTYPE int +#define SOCKTYPE int +#endif + #include <gnunet/gnunet_util_lib.h> #include "gnunet_protocols_ext.h" -- 2.21.0
_______________________________________________ GNUnet-developers mailing list [email protected] https://lists.gnu.org/mailman/listinfo/gnunet-developers
