From e0266175537ec220544c050874be215b11c902fa Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Mon, 11 Jul 2011 01:12:55 +0000 Subject: Shown a small version info with all major used directories. git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@209 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a --- ChangeLog | 8 ++++++++ configure.ac | 3 +++ src/main.c | 40 +++++++++++++++++++++++++++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bc64dc5..565f288 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 11-07-11 Cyrille Bagard + * configure.ac: + Define the plugins directory. + + * src/main.c: + Show a small version info with all major used directories. + +11-07-11 Cyrille Bagard + * src/analysis/binary.c: Load the type of binary from XML. diff --git a/configure.ac b/configure.ac index a60359b..ad71854 100644 --- a/configure.ac +++ b/configure.ac @@ -90,6 +90,7 @@ AC_CHECK_FUNCS([strrchr]) AH_TEMPLATE([VERSION], [Define the version number of the program for the about box.]) AH_TEMPLATE([PACKAGE_DATA_DIR], [Define the directory where the associated data will be installed.]) AH_TEMPLATE([PACKAGE_SOURCE_DIR], [Define the directory where the code source is waiting for being compiled.]) +AH_TEMPLATE([PLUGINS_DIR], [Define the directory where the plugins are installed.]) AH_TEMPLATE([LOCALE_DIR], [Define the directory where the message catalogs are installed.]) @@ -118,6 +119,8 @@ fi packagesrcdir=`cd $srcdir && pwd` AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}") +AC_DEFINE_UNQUOTED(PLUGINS_DIR, PACKAGE_DATA_DIR "/plugins") + if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(LOCALE_DIR, "${ac_default_prefix}/share/locale") else diff --git a/src/main.c b/src/main.c index fbf8b14..a3529ef 100644 --- a/src/main.c +++ b/src/main.c @@ -37,7 +37,7 @@ #include "glibext/delayed.h" #include "gtkext/support.h" #include "plugins/pglist.h" - +#include "../revision.h" #include "format/mangling/demangler.h" @@ -46,6 +46,36 @@ /****************************************************************************** * * +* Paramètres : - * +* * +* Description : Affiche des indications sur la version courante du programme.* +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static show_version(void) +{ + printf("\n"); + + printf("-o- OpenIDA r%u -o-\n", REVISION); + printf(_("Last compiled on %s at %s\n"), __DATE__, __TIME__); + + printf("\n"); + + printf(_("Data directory: %s\n"), PACKAGE_DATA_DIR); + printf(_("Plugins directory: %s\n"), PLUGINS_DIR); + printf(_("Locale directory: %s\n"), LOCALE_DIR); + + printf("\n"); + +} + + +/****************************************************************************** +* * * Paramètres : argc = nombre d'arguments dans la ligne de commande. * * argv = arguments de la ligne de commande. * * * @@ -64,6 +94,14 @@ int main(int argc, char **argv) const char *filename; /* Chemin du dernier projet */ openida_project *project; /* Nouveau projet courant */ + + if (argc > 1 && strcmp(argv[1], "--version") == 0) + { + show_version(); + return EXIT_SUCCESS; + } + + config = load_configuration("main", main_params, MPT_COUNT); set_main_configuration(config); -- cgit v0.11.2-87-g4458