diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2019-09-08 16:29:11 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-09-09 01:51:44 +0200 |
commit | d299b411ec72826aa87f629b52d07cdc5fc4ad29 (patch) | |
tree | c95f1b49cf231913034f4158c293c3bc5952fc4e | |
parent | 394dd1a50989a7096511a604ff0d8a0a7f8a5fe2 (diff) | |
download | gnunet-ext-d299b411ec72826aa87f629b52d07cdc5fc4ad29.tar.gz gnunet-ext-d299b411ec72826aa87f629b52d07cdc5fc4ad29.zip |
Add initialization to service
Signed-off-by: Christian Grothoff <christian@grothoff.org>
-rw-r--r-- | src/ext/gnunet-service-ext.c | 32 |
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 | |||
68 | */ | 68 | */ |
69 | static const struct GNUNET_CONFIGURATION_Handle *cfg; | 69 | static const struct GNUNET_CONFIGURATION_Handle *cfg; |
70 | 70 | ||
71 | /** | ||
72 | * This structure holds informations about the project. | ||
73 | */ | ||
74 | static const struct GNUNET_OS_ProjectData gnunetext_pd = | ||
75 | { | ||
76 | .libname = "libgnunetext", | ||
77 | .project_dirname = "gnunet-ext", | ||
78 | .binary_name = "gnunet-service-ext", | ||
79 | .env_varname = "GNUNET_EXT_PREFIX", | ||
80 | .base_config_varname = "GNUNET_EXT_BASE_CONFIG", | ||
81 | .bug_email = "gnunet-developers@gnu.org", | ||
82 | .homepage = "http://www.gnu.org/s/gnunet/", | ||
83 | .config_file = "gnunet-ext.conf", | ||
84 | .user_config_file = "~/.config/gnunet-ext.conf", | ||
85 | .version = "1.0", | ||
86 | .is_gnu = 1, | ||
87 | .gettext_domain = PACKAGE, | ||
88 | .gettext_path = NULL, | ||
89 | }; | ||
90 | |||
91 | /** | ||
92 | * Initialize the project with the data set in the | ||
93 | * GNUNET_OS_ProjectData structure. This is defined with | ||
94 | * __attribute__ ((constructor)) because it has to be called before | ||
95 | * the main function (implicitly defined by GNUNET_SERVICE_MAIN.) | ||
96 | * Other "pre-main" initialization can be performed here too. | ||
97 | */ | ||
98 | static void __attribute__ ((constructor)) | ||
99 | project_data_initialize (void) | ||
100 | { | ||
101 | GNUNET_OS_init (&gnunetext_pd); | ||
102 | } | ||
71 | 103 | ||
72 | /** | 104 | /** |
73 | * Handle EXT-message. | 105 | * Handle EXT-message. |