The API in this file is used to read the environment configuration file and set up a number of environment variables based on the values found in it.
More...
|
file | gnc-environment.h |
| code to set up the environment for proper gnucash functioning.
|
|
|
void | gnc_environment_setup (void) |
| Parse <prefix>/etc/gnucash/environment and set environment variables based on the contents of that file. More...
|
|
The API in this file is used to read the environment configuration file and set up a number of environment variables based on the values found in it.
These parameters can be used to configure certain aspects of gnucash or components it depends on.
For example if not installed in the standard prefix "/usr", environment variable XDG_DATA_DIRS should be set such that glib can find the gsettings schemas installed by GnuCash and yelp can find the help file and guide (if these are installed).
◆ gnc_environment_setup()
void gnc_environment_setup |
( |
void |
| ) |
|
Parse <prefix>/etc/gnucash/environment and set environment variables based on the contents of that file.
Read the comments in <prefix>/etc/gnucash/environment for more details.
Definition at line 165 of file gnc-environment.c.
172 env_parm = gnc_path_get_prefix();
173 if (!g_setenv(
"GNC_HOME", env_parm, FALSE))
174 g_warning (
"Couldn't set/override environment variable GNC_HOME.");
176 env_parm = gnc_path_get_bindir();
177 if (!g_setenv(
"GNC_BIN", env_parm, FALSE))
178 g_warning (
"Couldn't set/override environment variable GNC_BIN.");
180 env_parm = gnc_path_get_pkglibdir();
181 if (!g_setenv(
"GNC_LIB", env_parm, FALSE))
182 g_warning (
"Couldn't set/override environment variable GNC_LIB.");
184 env_parm = gnc_path_get_pkgdatadir();
185 if (!g_setenv(
"GNC_DATA", env_parm, FALSE))
186 g_warning (
"Couldn't set/override environment variable GNC_DATA.");
188 env_parm = gnc_path_get_pkgsysconfdir();
189 if (!g_setenv(
"GNC_CONF", env_parm, FALSE))
190 g_warning (
"Couldn't set/override environment variable GNC_CONF.");
192 env_parm = gnc_path_get_libdir();
193 if (!g_setenv(
"SYS_LIB", env_parm, FALSE))
194 g_warning (
"Couldn't set/override environment variable SYS_LIB.");
197 config_path = gnc_path_get_pkgsysconfdir();
201 gchar *pathext = g_build_path(
";",
".", g_getenv(
"PATHEXT"),
203 g_setenv(
"PATHEXT", pathext, TRUE);
209 env_path = g_build_filename (config_path,
"environment", NULL);
210 gnc_environment_parse_one(env_path);
214 env_path = g_build_filename (config_path,
"environment.local", NULL);
215 gnc_environment_parse_one(env_path);
217 g_free (config_path);