summaryrefslogtreecommitdiff
path: root/navit/main.c
diff options
context:
space:
mode:
authorlains <lains@caramail.com>2018-11-18 22:59:14 +0100
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2018-11-18 13:59:14 -0800
commite70a28963ff9754d3257361fad93aebf59edee08 (patch)
tree07a97ee212611ff4d1156baf87b8744f5d2b9ba4 /navit/main.c
parentb0773218ab67e00e1aa7303829f342dce87c46c0 (diff)
downloadnavit-e70a28963ff9754d3257361fad93aebf59edee08.tar.gz
Refactoring:Xmlconfig:Moving layout definition in their own .xml file (makes main navit.xml file lighter) (#559)
Layouts contain quite heavy xml code, and there are many layouts available for navit. They are all inserted inside the main navit.xml, which makes it hard to edit because of its size, even if changes or customizations by users are very rarely on the layout code. I have thus moved the layout code away from navit.xml, each layout having its own xml definition file, called navit_layout_*.xml These files are inserted inside the main navit.xml file by using the already existing xi:include mechanism, this also allow for backwards compatibility (old monolithic navit.xml files are still valid and can be used). The other advantage for this is that f the user wants to have his/her own customized navit.xml, he/she can still include the shipped layout files, making their xml lighter. This also allow to enable/disable specific layouts easily by including or not each layout file. It is also easier to perform side-by-side comparison between two layout files.
Diffstat (limited to 'navit/main.c')
-rw-r--r--navit/main.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/navit/main.c b/navit/main.c
index 75a3a5f93..986947f0d 100644
--- a/navit/main.c
+++ b/navit/main.c
@@ -73,10 +73,19 @@ void setenv(char *var, char *val, int overwrite) {
#endif
/*
- * environment_vars[][0:name,1-3:mode]
- * ':' replaced with NAVIT_PREFIX
- * '::' replaced with NAVIT_PREFIX and LIBDIR
- * '~' replaced with HOME
+ * @def environment_vars
+ *
+ * @brief Environment variables automatically added (and expanded) by navit at startup
+ *
+ * A NUL-terminated string array
+ * environment_vars[0] is the name of the variable
+ * environment_vars[1] is the value used when running from source dir
+ * environment_vars[2] is the value used on Linux
+ * environment_vars[3] is the value used on Windows (see main_init())
+ * environment_vars[4] is the value used on Android
+ * ':' is replaced with NAVIT_PREFIX
+ * '::' is replaced with NAVIT_PREFIX and LIBDIR
+ * '~' is replaced with HOME
*/
static char *environment_vars[][5]= {
{"NAVIT_LIBDIR", ":", ":/"LIB_DIR, ":\\lib", ":/lib"},
@@ -319,6 +328,10 @@ static void win_set_nls(void) {
}
#endif
+void main_update_default_layout(struct navit *navit) {
+ navit_update_current_layout(navit, NULL);
+}
+
void main_init(const char *program) {
char *s;
#ifdef _UNICODE /* currently for wince */