summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-08-08 17:24:16 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-08-08 17:24:16 +0200
commitdca05d8804fa5de0db1694d2ecb31f8a3075d901 (patch)
treead6d91a81d995fe62f7425ccc7e396659bf7fe37
parent7a593a5b8a4473da8506f478478f1f82f21cddc3 (diff)
pathes to remove platform.h from ext as it is not included and better help output; from ML; Thanks to Alessio Vanni
-rw-r--r--src/ext/ext_api.c12
-rw-r--r--src/ext/gnunet-ext.c34
-rw-r--r--src/ext/gnunet-service-ext.c12
-rw-r--r--src/ext/test_ext_api.c12
4 files changed, 66 insertions, 4 deletions
diff --git a/src/ext/ext_api.c b/src/ext/ext_api.c
index 65637d5..365dd89 100644
--- a/src/ext/ext_api.c
+++ b/src/ext/ext_api.c
@@ -23,7 +23,17 @@
* @brief API for ext
* @author
*/
-#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_ext_service.h"
diff --git a/src/ext/gnunet-ext.c b/src/ext/gnunet-ext.c
index 36fc02b..f18e351 100644
--- a/src/ext/gnunet-ext.c
+++ b/src/ext/gnunet-ext.c
@@ -23,13 +23,42 @@
* @brief ext tool
* @author
*/
-#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/gettext.h>
#include <gnunet/gnunet_util_lib.h>
#include "gnunet_ext_service.h"
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 = "gnunet-developers@gnu.org",
+ .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.
*
* @param cls closure
@@ -60,6 +89,9 @@ main (int argc, char *const *argv)
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
+
+ GNUNET_OS_init(&gnunetext_pd);
+
return (GNUNET_OK ==
GNUNET_PROGRAM_run (argc,
argv,
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"
diff --git a/src/ext/test_ext_api.c b/src/ext/test_ext_api.c
index 75a7cc4..e69dca0 100644
--- a/src/ext/test_ext_api.c
+++ b/src/ext/test_ext_api.c
@@ -21,7 +21,17 @@
* @file ext/test_ext_api.c
* @brief testcase for ext_api.c
*/
-#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_ext_service.h"