diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2014-07-10 14:47:37 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2014-07-10 14:47:37 (GMT) |
commit | db863244b804cbf4c06399f7c6f8241d91c9ee9b (patch) | |
tree | da7cc911b0f10c5122536271235ab68f2202804a /src/main.c | |
parent | e8aa314462196cc9e8461ae23eb13f8bffcc983f (diff) |
Fully rewritten the core configuration system.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@381 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 25 |
1 files changed, 12 insertions, 13 deletions
@@ -30,10 +30,11 @@ #include <i18n.h> #include "editor.h" -#include "params.h" #include "project.h" #include "analysis/db/server.h" #include "arch/processor.h" +#include "core/core.h" +#include "core/params.h" #include "format/format.h" #include "glibext/delayed.h" #include "glibext/gbinportion.h" @@ -42,11 +43,9 @@ #include "../revision.h" +// TODO : remme! #include "format/mangling/itanium/abi.h" - - -/* params.c : configuration générale */ -extern config_param main_params[MPT_COUNT]; +#include "analysis/db/cdb.h" @@ -66,7 +65,7 @@ static void show_version(void) { printf("\n"); - printf("-o- OpenIDA r%u -o-\n", REVISION); + printf("-o- Chrysalide r%u -o-\n", REVISION); printf(_("Last compiled on %s at %s\n"), __DATE__, __TIME__); printf("\n"); @@ -78,7 +77,7 @@ static void show_version(void) printf("\n"); } -#include "analysis/db/cdb.h" + /****************************************************************************** * * @@ -95,7 +94,6 @@ static void show_version(void) int main(int argc, char **argv) { - configuration *config; /* Configuration principale */ GtkWidget *editor; /* Fenêtre graphique */ GDbServer *server; /* Enregistrements locaux */ const char *filename; /* Chemin du dernier projet */ @@ -107,9 +105,6 @@ int main(int argc, char **argv) return EXIT_SUCCESS; } - config = load_configuration("main", main_params, MPT_COUNT); - set_main_configuration(config); - setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALE_DIR); textdomain(PACKAGE); @@ -119,6 +114,9 @@ int main(int argc, char **argv) setlocale (LC_ALL, ""); gtk_init(&argc, &argv); + if (!load_all_basic_components()) + return EXIT_FAILURE; + /* * this initialize the library and check potential ABI mismatches * between the version it was compiled for and the actual shared @@ -176,7 +174,8 @@ int main(int argc, char **argv) /* Charge le dernier projet */ - filename = get_string_config_value(config, MPT_LAST_PROJECT); + if (!g_generic_config_get_value(get_main_configuration(), MPK_LAST_PROJECT, &filename)) + filename = NULL; if (filename == NULL) project = g_study_project_new(G_OBJECT(editor)); else project = g_study_project_open(G_OBJECT(editor), filename); @@ -193,7 +192,7 @@ int main(int argc, char **argv) exit_binary_portion_colors(); - unload_configuration(config); + unload_all_basic_components(); return EXIT_SUCCESS; |