summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Vanni <vannilla@firemail.cc>2019-09-08 16:29:11 +0200
committerChristian Grothoff <christian@grothoff.org>2019-09-09 01:51:44 +0200
commitd299b411ec72826aa87f629b52d07cdc5fc4ad29 (patch)
treec95f1b49cf231913034f4158c293c3bc5952fc4e
parent394dd1a50989a7096511a604ff0d8a0a7f8a5fe2 (diff)
Add initialization to service
Signed-off-by: Christian Grothoff <christian@grothoff.org>
-rw-r--r--src/ext/gnunet-service-ext.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/ext/gnunet-service-ext.c b/src/ext/gnunet-service-ext.c
index 4ebcdf2..83cbd52 100644
--- a/src/ext/gnunet-service-ext.c
+++ b/src/ext/gnunet-service-ext.c
@@ -68,6 +68,38 @@ struct ClientContext
*/
static const struct GNUNET_CONFIGURATION_Handle *cfg;
+/**
+ * This structure holds informations about the project.
+ */
+static const struct GNUNET_OS_ProjectData gnunetext_pd =
+{
+ .libname = "libgnunetext",
+ .project_dirname = "gnunet-ext",
+ .binary_name = "gnunet-service-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,
+ .gettext_domain = PACKAGE,
+ .gettext_path = NULL,
+};
+
+/**
+ * Initialize the project with the data set in the
+ * GNUNET_OS_ProjectData structure. This is defined with
+ * __attribute__ ((constructor)) because it has to be called before
+ * the main function (implicitly defined by GNUNET_SERVICE_MAIN.)
+ * Other "pre-main" initialization can be performed here too.
+ */
+static void __attribute__ ((constructor))
+project_data_initialize (void)
+{
+ GNUNET_OS_init (&gnunetext_pd);
+}
/**
* Handle EXT-message.