diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-03-31 18:52:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-03-31 18:52:13 +0000 |
commit | 669d5032383c22014233fe0732a5485494b1b469 (patch) | |
tree | a97f92769defed730ad0458f4e754edfe045dde3 /src/include/gnunet_os_lib.h | |
parent | 2f89dd84130dbeeb6166ebf9500f3be8201b3023 (diff) | |
download | gnunet-669d5032383c22014233fe0732a5485494b1b469.tar.gz gnunet-669d5032383c22014233fe0732a5485494b1b469.zip |
extend GNUNET_OS-API to allow re-use of os_installation logic for programs with different libs, paths, binaries and environment variables
Diffstat (limited to 'src/include/gnunet_os_lib.h')
-rw-r--r-- | src/include/gnunet_os_lib.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index eca64b7f1..8cd4a4578 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -200,6 +200,66 @@ enum GNUNET_OS_ProcessStatusType | |||
200 | 200 | ||
201 | 201 | ||
202 | /** | 202 | /** |
203 | * Project-specific data used to help the OS subsystem | ||
204 | * find installation paths. | ||
205 | */ | ||
206 | struct GNUNET_OS_ProjectData | ||
207 | { | ||
208 | /** | ||
209 | * Name of a library that is installed in the "lib/" directory of | ||
210 | * the project, such as "libgnunetutil". Used to locate the | ||
211 | * installation by scanning dependencies of the current process. | ||
212 | */ | ||
213 | const char *libname; | ||
214 | |||
215 | /** | ||
216 | * Name of the project that is used in the "libexec" prefix, For | ||
217 | * example, "gnunet". Certain helper binaries are then expected to | ||
218 | * be installed in "$PREFIX/libexec/gnunet/" and resources in | ||
219 | * "$PREFIX/share/gnunet/". | ||
220 | */ | ||
221 | const char *project_dirname; | ||
222 | |||
223 | /** | ||
224 | * Name of a project-specific binary that should be in "$PREFIX/bin/". | ||
225 | * Used to determine installation path from $PATH variable. | ||
226 | * For example "gnunet-arm". On W32, ".exe" should be omitted. | ||
227 | */ | ||
228 | const char *binary_name; | ||
229 | |||
230 | /** | ||
231 | * Name of an environment variable that can be used to override | ||
232 | * installation path detection, for example "GNUNET_PREFIX". | ||
233 | */ | ||
234 | const char *env_varname; | ||
235 | |||
236 | /** | ||
237 | * Alternative name of an environment variable that can be used to | ||
238 | * override installation path detection, if "env_varname" is not | ||
239 | * set. Again, for example, "GNUNET_PREFIX". | ||
240 | */ | ||
241 | const char *env_varname_alt; | ||
242 | |||
243 | }; | ||
244 | |||
245 | |||
246 | /** | ||
247 | * Return default project data used by 'libgnunetutil' for GNUnet. | ||
248 | */ | ||
249 | const struct GNUNET_OS_ProjectData * | ||
250 | GNUNET_OS_project_data_default (void); | ||
251 | |||
252 | |||
253 | /** | ||
254 | * Setup OS subsystem with project data. | ||
255 | * | ||
256 | * @param pd project data used to determine paths. | ||
257 | */ | ||
258 | void | ||
259 | GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd); | ||
260 | |||
261 | |||
262 | /** | ||
203 | * Get the path to a specific GNUnet installation directory or, with | 263 | * Get the path to a specific GNUnet installation directory or, with |
204 | * #GNUNET_OS_IPK_SELF_PREFIX, the current running apps installation | 264 | * #GNUNET_OS_IPK_SELF_PREFIX, the current running apps installation |
205 | * directory. | 265 | * directory. |