diff options
author | Christophe Grenier <grenier@cgsecurity.org> | 2011-11-15 07:16:09 +0100 |
---|---|---|
committer | Christophe Grenier <grenier@cgsecurity.org> | 2011-11-15 07:16:09 +0100 |
commit | 681a2531a2229c23e10275f8ee566201a729a3e1 (patch) | |
tree | cccf7cc7b2cc1f36d53a08f5025414ce349b3d56 | |
parent | e97359ef26949b69100d3c180f9b2852b706b9b2 (diff) |
Use "./configure --disable-dfxml" to disable DFXML feature
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | src/dfxml.c | 2 | ||||
-rw-r--r-- | src/phmain.c | 2 | ||||
-rw-r--r-- | src/photorec.c | 4 | ||||
-rw-r--r-- | src/phrecn.c | 4 |
5 files changed, 22 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index df59143..187a7f9 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_PREREQ([2.59]) AC_INIT([testdisk],[6.13-WIP],[grenier@cgsecurity.org]) sinclude(acx_pthread.m4) -TESTDISKDATE="May 2011" +TESTDISKDATE="November 2011" AC_SUBST(TESTDISKDATE) AC_DEFINE_UNQUOTED([TESTDISKDATE],"$TESTDISKDATE",[Date of release]) AC_CONFIG_AUX_DIR(config) @@ -211,6 +211,15 @@ AC_ARG_ENABLE([ncmouse], esac], [use_ncmouse=false]) +AC_ARG_ENABLE([dfxml], + AS_HELP_STRING(--disable-dfxml), + [case "${enableval}" in + yes) AC_DEFINE([ENABLE_DFXML],1,[Define to 1 if DFXML log is enabled]) ;; + no) ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-dfxml]) ;; + esac], + [AC_DEFINE([ENABLE_DFXML],1,[Define to 1 if DFXML log is enabled])]) + use_icon=no case "$target" in diff --git a/src/dfxml.c b/src/dfxml.c index b621748..e9385a1 100644 --- a/src/dfxml.c +++ b/src/dfxml.c @@ -24,6 +24,7 @@ #include <config.h> #endif +#ifdef ENABLE_DFXML #include <stdio.h> #ifdef HAVE_STDLIB_H #include <stdlib.h> @@ -371,3 +372,4 @@ void xml_log_file_recovered2(const alloc_data_t *space, const file_recovery_t *f xml_pop("byte_runs"); xml_pop("fileobject"); } +#endif diff --git a/src/phmain.c b/src/phmain.c index ac9213c..e8d8665 100644 --- a/src/phmain.c +++ b/src/phmain.c @@ -251,7 +251,9 @@ int main( int argc, char **argv ) free(params.recup_dir); return 0; } +#ifdef ENABLE_DFXML xml_set_command_line(argc, argv); +#endif if(create_log!=TD_LOG_NONE) log_handle=log_open(logfile, create_log); #ifdef HAVE_SETLOCALE diff --git a/src/photorec.c b/src/photorec.c index 9ac6d00..6590e5b 100644 --- a/src/photorec.c +++ b/src/photorec.c @@ -660,7 +660,9 @@ int file_finish(file_recovery_t *file_recovery, struct ph_param *params, else { list_space_used(file_recovery, params->disk->sector_size); +#ifdef ENABLE_DFXML xml_log_file_recovered(file_recovery); +#endif update_search_space(file_recovery, list_search_space, current_search_space, offset, params->blocksize); file_recovered=1; /* note that file was recovered */ } @@ -752,7 +754,9 @@ alloc_data_t *file_finish2(file_recovery_t *file_recovery, struct ph_param *para } else { +#ifdef ENABLE_DFXML xml_log_file_recovered2(list_search_space, file_recovery); +#endif datanext=file_truncate(list_search_space, file_recovery, params->disk->sector_size, params->blocksize); } free_list_allocation(&file_recovery->location); diff --git a/src/phrecn.c b/src/phrecn.c index cf4125b..c92bbbd 100644 --- a/src/phrecn.c +++ b/src/phrecn.c @@ -825,9 +825,11 @@ int photorec(struct ph_param *params, const struct ph_options *options, alloc_da /* make the first recup_dir */ params->dir_num=photorec_mkdir(params->recup_dir, params->dir_num); +#ifdef ENABLE_DFXML /* Open the XML output file */ xml_open(params->recup_dir, params->dir_num); xml_setup(params->disk, params->partition); +#endif for(params->pass=0; params->status!=STATUS_QUIT; params->pass++) { @@ -1069,8 +1071,10 @@ int photorec(struct ph_param *params, const struct ph_options *options, alloc_da free(params->file_stats); params->file_stats=NULL; free_header_check(); +#ifdef ENABLE_DFXML xml_shutdown(); xml_close(); +#endif return 0; } |