diff --git a/Makefile.am b/Makefile.am index 35b98a2..44cdd65 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,6 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ include \ common \ - libcstring \ libcerror \ libcthreads \ libcdata \ @@ -86,7 +85,6 @@ lib: library library: (cd $(srcdir)/common && $(MAKE) $(AM_MAKEFLAGS)) - (cd $(srcdir)/libcstring && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcerror && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdata && $(MAKE) $(AM_MAKEFLAGS)) (cd $(srcdir)/libclocale && $(MAKE) $(AM_MAKEFLAGS)) @@ -119,7 +117,6 @@ distclean: clean done && test -z "$$fail" splint: - (cd $(srcdir)/libcstring && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcerror && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdata && $(MAKE) splint $(AM_MAKEFLAGS)) (cd $(srcdir)/libcdatetime && $(MAKE) splint $(AM_MAKEFLAGS)) diff --git a/common/byte_stream.h b/common/byte_stream.h index 21a1d65..6e79e99 100644 --- a/common/byte_stream.h +++ b/common/byte_stream.h @@ -1,7 +1,7 @@ /* * Byte stream functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/common.h b/common/common.h index 066ade6..6eca279 100644 --- a/common/common.h +++ b/common/common.h @@ -1,7 +1,7 @@ /* * Common include file * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/config_borlandc.h b/common/config_borlandc.h index 68e5cbc..202e5d6 100644 --- a/common/config_borlandc.h +++ b/common/config_borlandc.h @@ -1,7 +1,7 @@ /* * Configuration for the Borland/CodeGear C++ Builder compiler * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/config_msc.h b/common/config_msc.h index 83851a0..a45220d 100644 --- a/common/config_msc.h +++ b/common/config_msc.h @@ -1,7 +1,7 @@ /* * Configuration for the Microsoft Visual Studio C++ compiler * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/config_winapi.h b/common/config_winapi.h index 8fd08b3..9c6efe7 100644 --- a/common/config_winapi.h +++ b/common/config_winapi.h @@ -1,7 +1,7 @@ /* * Configuration file for WINAPI * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/file_stream.h b/common/file_stream.h index e185018..45b4c27 100644 --- a/common/file_stream.h +++ b/common/file_stream.h @@ -1,7 +1,7 @@ /* * FILE stream functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/memory.h b/common/memory.h index c3d095f..aa2d6d8 100644 --- a/common/memory.h +++ b/common/memory.h @@ -1,7 +1,7 @@ /* * Memory functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/narrow_string.h b/common/narrow_string.h index d1c2231..74b81e1 100644 --- a/common/narrow_string.h +++ b/common/narrow_string.h @@ -1,7 +1,7 @@ /* * Narrow character string functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/system_string.h b/common/system_string.h index 7ffc7d5..b5d3590 100644 --- a/common/system_string.h +++ b/common/system_string.h @@ -1,7 +1,7 @@ /* * System character string functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/types.h.in b/common/types.h.in index 35b26ff..b857633 100644 --- a/common/types.h.in +++ b/common/types.h.in @@ -1,7 +1,7 @@ /* * Type and type-support defintions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/common/wide_string.h b/common/wide_string.h index db1eb19..a12fff9 100644 --- a/common/wide_string.h +++ b/common/wide_string.h @@ -1,7 +1,7 @@ /* * Wide character string functions * - * Copyright (C) 2006-2018, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * diff --git a/configure.ac b/configure.ac index c7d318a..d682134 100644 --- a/configure.ac +++ b/configure.ac @@ -68,9 +68,6 @@ AX_TYPES_CHECK_LOCAL dnl Checks for libraries and library functions AX_COMMON_CHECK_LOCAL -dnl Check for enabling libcstring for cross-platform C string functions -AX_LIBCSTRING_CHECK_ENABLE - dnl Check for enabling libcerror for cross-platform C error functions AX_LIBCERROR_CHECK_ENABLE @@ -194,7 +191,7 @@ CFLAGS="$CFLAGS -Wall"; dnl Check if requires and build requires should be set in spec file AS_IF( - [test "x$ac_cv_libcstring" = xyes || test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes || test "x$ac_cv_libfcache" = xyes || test "x$ac_cv_libfdata" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libmfdata" = xyes || test "x$ac_cv_zlib" != xno || test "x$ac_cv_libhmac" = xyes], + [test "x$ac_cv_libcerror" = xyes || test "x$ac_cv_libcthreads" = xyes || test "x$ac_cv_libcdata" = xyes || test "x$ac_cv_libclocale" = xyes || test "x$ac_cv_libcnotify" = xyes || test "x$ac_cv_libcsplit" = xyes || test "x$ac_cv_libuna" = xyes || test "x$ac_cv_libcfile" = xyes || test "x$ac_cv_libcpath" = xyes || test "x$ac_cv_libbfio" = xyes || test "x$ac_cv_libfcache" = xyes || test "x$ac_cv_libfdata" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libmfdata" = xyes || test "x$ac_cv_zlib" != xno || test "x$ac_cv_libhmac" = xyes], [AC_SUBST( [libewf_spec_requires], [Requires:]) @@ -221,7 +218,6 @@ dnl Generate Makefiles AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([include/Makefile]) AC_CONFIG_FILES([common/Makefile]) -AC_CONFIG_FILES([libcstring/Makefile]) AC_CONFIG_FILES([libcerror/Makefile]) AC_CONFIG_FILES([libcthreads/Makefile]) AC_CONFIG_FILES([libcdata/Makefile]) @@ -275,7 +271,6 @@ AC_OUTPUT dnl Print a summary AC_MSG_NOTICE([ Building: - libcstring support: $ac_cv_libcstring libcerror support: $ac_cv_libcerror libcthreads support: $ac_cv_libcthreads libcdata support: $ac_cv_libcdata diff --git a/ewftools-mt/Makefile.am b/ewftools-mt/Makefile.am index 5617ad1..272f87c 100644 --- a/ewftools-mt/Makefile.am +++ b/ewftools-mt/Makefile.am @@ -2,7 +2,6 @@ if HAVE_CXX11 AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCDATETIME_CPPFLAGS@ \ @@ -48,7 +47,6 @@ ewfacquirestream_SOURCES = \ ../ewftools/ewftools_libcnotify.h \ ../ewftools/ewftools_libcpath.h \ ../ewftools/ewftools_libcsplit.h \ - ../ewftools/ewftools_libcstring.h \ ../ewftools/ewftools_libewf.h \ ../ewftools/ewftools_libhmac.h \ ../ewftools/ewftools_libodraw.h \ @@ -74,7 +72,6 @@ ewfacquirestream_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ \ @PTHREAD_LIBADD@ \ -lstdc++ diff --git a/ewftools-mt/ewfacquirestream.c b/ewftools-mt/ewfacquirestream.c index 3ea5d06..163f652 100644 --- a/ewftools-mt/ewfacquirestream.c +++ b/ewftools-mt/ewfacquirestream.c @@ -22,7 +22,10 @@ #include #include +#include +#include #include +#include #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include @@ -43,7 +46,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -62,10 +64,10 @@ int verbose_mt = 0; void usage_fprint( FILE *stream ) { - libcstring_system_character_t default_segment_file_size_string[ 16 ]; - libcstring_system_character_t minimum_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_32bit_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_64bit_segment_file_size_string[ 16 ]; + system_character_t default_segment_file_size_string[ 16 ]; + system_character_t minimum_segment_file_size_string[ 16 ]; + system_character_t maximum_32bit_segment_file_size_string[ 16 ]; + system_character_t maximum_64bit_segment_file_size_string[ 16 ]; int result = 0; @@ -162,9 +164,9 @@ void usage_fprint( if( result == 1 ) { - fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_LIBCSTRING_SYSTEM ")\n" - "\t (minimum is %" PRIs_LIBCSTRING_SYSTEM ", maximum is %" PRIs_LIBCSTRING_SYSTEM " for encase6 and\n" - "\t encase7 format and %" PRIs_LIBCSTRING_SYSTEM " for other formats)\n", + fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_SYSTEM ")\n" + "\t (minimum is %" PRIs_SYSTEM ", maximum is %" PRIs_SYSTEM " for encase6 and\n" + "\t encase7 format and %" PRIs_SYSTEM " for other formats)\n", default_segment_file_size_string, minimum_segment_file_size_string, maximum_64bit_segment_file_size_string, @@ -552,9 +554,9 @@ int ewfacquirestream_read_input( } if( process_status_initialize( &process_status, - _LIBCSTRING_SYSTEM_STRING( "Acquiry" ), - _LIBCSTRING_SYSTEM_STRING( "acquired" ), - _LIBCSTRING_SYSTEM_STRING( "Written" ), + _SYSTEM_STRING( "Acquiry" ), + _SYSTEM_STRING( "acquired" ), + _SYSTEM_STRING( "Written" ), stdout, print_status_information, error ) != 1 ) @@ -926,7 +928,7 @@ int ewfacquirestream_read_input( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -934,31 +936,31 @@ int main( int argc, char * const argv[] ) { libcerror_error_t *error = NULL; - libcstring_system_character_t *log_filename = NULL; - libcstring_system_character_t *option_additional_digest_types = NULL; - libcstring_system_character_t *option_bytes_per_sector = NULL; - libcstring_system_character_t *option_case_number = NULL; - libcstring_system_character_t *option_compression_values = NULL; - libcstring_system_character_t *option_description = NULL; - libcstring_system_character_t *option_examiner_name = NULL; - libcstring_system_character_t *option_evidence_number = NULL; - libcstring_system_character_t *option_format = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *option_maximum_segment_size = NULL; - libcstring_system_character_t *option_media_flags = NULL; - libcstring_system_character_t *option_media_type = NULL; - libcstring_system_character_t *option_notes = NULL; - libcstring_system_character_t *option_offset = NULL; - libcstring_system_character_t *option_process_buffer_size = NULL; - libcstring_system_character_t *option_secondary_target_filename = NULL; - libcstring_system_character_t *option_sectors_per_chunk = NULL; - libcstring_system_character_t *option_size = NULL; - libcstring_system_character_t *option_target_filename = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfacquirestream" ); + system_character_t *log_filename = NULL; + system_character_t *option_additional_digest_types = NULL; + system_character_t *option_bytes_per_sector = NULL; + system_character_t *option_case_number = NULL; + system_character_t *option_compression_values = NULL; + system_character_t *option_description = NULL; + system_character_t *option_examiner_name = NULL; + system_character_t *option_evidence_number = NULL; + system_character_t *option_format = NULL; + system_character_t *option_header_codepage = NULL; + system_character_t *option_maximum_segment_size = NULL; + system_character_t *option_media_flags = NULL; + system_character_t *option_media_type = NULL; + system_character_t *option_notes = NULL; + system_character_t *option_offset = NULL; + system_character_t *option_process_buffer_size = NULL; + system_character_t *option_secondary_target_filename = NULL; + system_character_t *option_sectors_per_chunk = NULL; + system_character_t *option_size = NULL; + system_character_t *option_target_filename = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfacquirestream" ); log_handle_t *log_handle = NULL; - libcstring_system_integer_t option = 0; + system_integer_t option = 0; size_t string_length = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; @@ -1027,11 +1029,11 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:b:B:c:C:d:D:e:E:f:hl:m:M:N:o:p:P:qsS:t:vVz2:" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:b:B:c:C:d:D:e:E:f:hl:m:M:N:o:p:P:qsS:t:vVz2:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: ewftools_output_version_fprint( stdout, @@ -1039,7 +1041,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( @@ -1047,57 +1049,57 @@ int main( int argc, char * const argv[] ) goto on_error; - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'b': + case (system_integer_t) 'b': option_sectors_per_chunk = optarg; break; - case (libcstring_system_integer_t) 'B': + case (system_integer_t) 'B': option_size = optarg; break; - case (libcstring_system_integer_t) 'c': + case (system_integer_t) 'c': option_compression_values = optarg; break; - case (libcstring_system_integer_t) 'C': + case (system_integer_t) 'C': option_case_number = optarg; break; - case (libcstring_system_integer_t) 'd': + case (system_integer_t) 'd': option_additional_digest_types = optarg; break; - case (libcstring_system_integer_t) 'D': + case (system_integer_t) 'D': option_description = optarg; break; - case (libcstring_system_integer_t) 'e': + case (system_integer_t) 'e': option_examiner_name = optarg; break; - case (libcstring_system_integer_t) 'E': + case (system_integer_t) 'E': option_evidence_number = optarg; break; - case (libcstring_system_integer_t) 'f': + case (system_integer_t) 'f': option_format = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); @@ -1107,67 +1109,67 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'l': + case (system_integer_t) 'l': log_filename = optarg; break; - case (libcstring_system_integer_t) 'm': + case (system_integer_t) 'm': option_media_type = optarg; break; - case (libcstring_system_integer_t) 'M': + case (system_integer_t) 'M': option_media_flags = optarg; break; - case (libcstring_system_integer_t) 'N': + case (system_integer_t) 'N': option_notes = optarg; break; - case (libcstring_system_integer_t) 'o': + case (system_integer_t) 'o': option_offset = optarg; break; - case (libcstring_system_integer_t) 'p': + case (system_integer_t) 'p': option_process_buffer_size = optarg; break; - case (libcstring_system_integer_t) 'P': + case (system_integer_t) 'P': option_bytes_per_sector = optarg; break; - case (libcstring_system_integer_t) 'q': + case (system_integer_t) 'q': print_status_information = 0; break; - case (libcstring_system_integer_t) 's': + case (system_integer_t) 's': swap_byte_pairs = 1; break; - case (libcstring_system_integer_t) 'S': + case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; - case (libcstring_system_integer_t) 't': + case (system_integer_t) 't': option_target_filename = optarg; break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); @@ -1177,12 +1179,12 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'z': + case (system_integer_t) 'z': verbose_mt = 1; break; - case (libcstring_system_integer_t) '2': + case (system_integer_t) '2': option_secondary_target_filename = optarg; break; @@ -1206,13 +1208,13 @@ int main( int argc, char * const argv[] ) if( ( option_target_filename != NULL ) && ( option_secondary_target_filename != NULL ) ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_secondary_target_filename ); - if( libcstring_system_string_length( + if( system_string_length( option_target_filename ) == string_length ) { - if( libcstring_system_string_compare( + if( system_string_compare( option_target_filename, option_secondary_target_filename, string_length ) == 0 ) @@ -1283,7 +1285,7 @@ int main( int argc, char * const argv[] ) */ if( imaging_handle_set_string( ewfacquirestream_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "image" ), + _SYSTEM_STRING( "image" ), &( ewfacquirestream_imaging_handle->target_filename ), &( ewfacquirestream_imaging_handle->target_filename_size ), &error ) != 1 ) @@ -1313,7 +1315,7 @@ int main( int argc, char * const argv[] ) } if( option_case_number == NULL ) { - option_case_number = _LIBCSTRING_SYSTEM_STRING( "case_number" ); + option_case_number = _SYSTEM_STRING( "case_number" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1330,7 +1332,7 @@ int main( int argc, char * const argv[] ) } if( option_description == NULL ) { - option_description = _LIBCSTRING_SYSTEM_STRING( "description" ); + option_description = _SYSTEM_STRING( "description" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1347,7 +1349,7 @@ int main( int argc, char * const argv[] ) } if( option_evidence_number == NULL ) { - option_evidence_number = _LIBCSTRING_SYSTEM_STRING( "evidence_number" ); + option_evidence_number = _SYSTEM_STRING( "evidence_number" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1364,7 +1366,7 @@ int main( int argc, char * const argv[] ) } if( option_examiner_name == NULL ) { - option_examiner_name = _LIBCSTRING_SYSTEM_STRING( "examiner_name" ); + option_examiner_name = _SYSTEM_STRING( "examiner_name" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1381,7 +1383,7 @@ int main( int argc, char * const argv[] ) } if( option_notes == NULL ) { - option_notes = _LIBCSTRING_SYSTEM_STRING( "notes" ); + option_notes = _SYSTEM_STRING( "notes" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1702,7 +1704,7 @@ int main( int argc, char * const argv[] ) if( imaging_handle_set_output_values( ewfacquirestream_imaging_handle, program, - _LIBCSTRING_SYSTEM_STRING( LIBEWF_VERSION_STRING ), + _SYSTEM_STRING( LIBEWF_VERSION_STRING ), NULL, NULL, &error ) != 1 ) @@ -1745,7 +1747,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to open log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -1832,7 +1834,7 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); @@ -1841,14 +1843,14 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": FAILURE\n", + "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": SUCCESS\n", + "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); diff --git a/ewftools-mt/threading_test.cpp b/ewftools-mt/threading_test.cpp index 719f2cb..489d406 100644 --- a/ewftools-mt/threading_test.cpp +++ b/ewftools-mt/threading_test.cpp @@ -60,7 +60,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "imaging_handle.h" #include "log_handle.h" @@ -329,13 +328,13 @@ void writer( int start_threads_testing() { - libcerror_error_t *error = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "threading_test" ); - storage_media_buffer_t *src = NULL; - storage_media_buffer_t *mid = NULL; - storage_media_buffer_t *target = NULL; - const char *function = "start_threads_testing"; - uint8_t running = 0; + libcerror_error_t *error = NULL; + storage_media_buffer_t *mid = NULL; + storage_media_buffer_t *src = NULL; + storage_media_buffer_t *target = NULL; + system_character_t *program = _SYSTEM_STRING( "threading_test" ); + const char *function = "start_threads_testing"; + uint8_t running = 0; /* initialize random seed: */ srand (time(NULL)); @@ -475,7 +474,7 @@ int start_threads_testing() } int verbose_mt = 1; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) diff --git a/ewftools/Makefile.am b/ewftools/Makefile.am index 205734e..a37ce27 100644 --- a/ewftools/Makefile.am +++ b/ewftools/Makefile.am @@ -1,7 +1,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCDATETIME_CPPFLAGS@ \ @@ -52,7 +51,6 @@ ewfacquire_SOURCES = \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ @@ -91,7 +89,6 @@ ewfacquire_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ ewfacquirestream_SOURCES = \ @@ -109,7 +106,6 @@ ewfacquirestream_SOURCES = \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ @@ -139,7 +135,6 @@ ewfacquirestream_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ ewfdebug_SOURCES = \ @@ -154,7 +149,6 @@ ewfdebug_SOURCES = \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ @@ -172,7 +166,6 @@ ewfdebug_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ ewfexport_SOURCES = \ @@ -193,7 +186,6 @@ ewfexport_SOURCES = \ ewftools_libcnotify.h \ ewftools_libcpath.h \ ewftools_libcsplit.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ @@ -230,7 +222,6 @@ ewfexport_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ ewfinfo_SOURCES = \ @@ -247,7 +238,6 @@ ewfinfo_SOURCES = \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcsplit.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ @@ -270,7 +260,6 @@ ewfinfo_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ ewfmount_SOURCES = \ @@ -287,7 +276,6 @@ ewfmount_SOURCES = \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libfvalue.h \ ewftools_libhmac.h \ @@ -337,7 +325,6 @@ ewfrecover_SOURCES = \ ewftools_libclocale.h \ ewftools_libcnotify.h \ ewftools_libcpath.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ @@ -374,7 +361,6 @@ ewfrecover_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ ewfverify_SOURCES = \ @@ -391,7 +377,6 @@ ewfverify_SOURCES = \ ewftools_libcerror.h \ ewftools_libclocale.h \ ewftools_libcnotify.h \ - ewftools_libcstring.h \ ewftools_libewf.h \ ewftools_libhmac.h \ ewftools_libodraw.h \ @@ -420,7 +405,6 @@ ewfverify_LDADD = \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ \ @LIBINTL@ MAINTAINERCLEANFILES = \ diff --git a/ewftools/byte_size_string.c b/ewftools/byte_size_string.c index 5479ec1..ae304b0 100644 --- a/ewftools/byte_size_string.c +++ b/ewftools/byte_size_string.c @@ -20,26 +20,28 @@ */ #include +#include +#include #include +#include #include "byte_size_string.h" #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" /* Creates a human readable byte size string * Returns 1 if successful or -1 on error */ int byte_size_string_create( - libcstring_system_character_t *byte_size_string, + system_character_t *byte_size_string, size_t byte_size_string_length, uint64_t size, int units, libcerror_error_t **error ) { - const libcstring_system_character_t *factor_string = NULL; - const libcstring_system_character_t *units_string = NULL; + const system_character_t *factor_string = NULL; + const system_character_t *units_string = NULL; static char *function = "byte_size_string_create"; ssize_t print_count = 0; uint64_t factored_size = 0; @@ -75,11 +77,11 @@ int byte_size_string_create( if( ( size < 1024 ) || ( units == BYTE_SIZE_STRING_UNIT_MEGABYTE ) ) { - units_string = _LIBCSTRING_SYSTEM_STRING( "B" ); + units_string = _SYSTEM_STRING( "B" ); } else if( units == BYTE_SIZE_STRING_UNIT_MEBIBYTE ) { - units_string = _LIBCSTRING_SYSTEM_STRING( "iB" ); + units_string = _SYSTEM_STRING( "iB" ); } factored_size = size; @@ -112,31 +114,31 @@ int byte_size_string_create( switch( factor ) { case 0: - factor_string = _LIBCSTRING_SYSTEM_STRING( "" ); + factor_string = _SYSTEM_STRING( "" ); break; case 1: - factor_string = _LIBCSTRING_SYSTEM_STRING( "K" ); + factor_string = _SYSTEM_STRING( "K" ); break; case 2: - factor_string = _LIBCSTRING_SYSTEM_STRING( "M" ); + factor_string = _SYSTEM_STRING( "M" ); break; case 3: - factor_string = _LIBCSTRING_SYSTEM_STRING( "G" ); + factor_string = _SYSTEM_STRING( "G" ); break; case 4: - factor_string = _LIBCSTRING_SYSTEM_STRING( "T" ); + factor_string = _SYSTEM_STRING( "T" ); break; case 5: - factor_string = _LIBCSTRING_SYSTEM_STRING( "P" ); + factor_string = _SYSTEM_STRING( "P" ); break; case 6: - factor_string = _LIBCSTRING_SYSTEM_STRING( "E" ); + factor_string = _SYSTEM_STRING( "E" ); break; case 7: - factor_string = _LIBCSTRING_SYSTEM_STRING( "Z" ); + factor_string = _SYSTEM_STRING( "Z" ); break; case 8: - factor_string = _LIBCSTRING_SYSTEM_STRING( "Y" ); + factor_string = _SYSTEM_STRING( "Y" ); break; } if( remainder > 9 ) @@ -158,28 +160,28 @@ int byte_size_string_create( return( -1 ); } - print_count = libcstring_system_string_sprintf( + print_count = system_string_sprintf( byte_size_string, byte_size_string_length, - _LIBCSTRING_SYSTEM_STRING( "%" ) _LIBCSTRING_SYSTEM_STRING( PRIu64 ) - _LIBCSTRING_SYSTEM_STRING( "%" ) _LIBCSTRING_SYSTEM_STRING( PRIc_LIBCSTRING_SYSTEM ) - _LIBCSTRING_SYSTEM_STRING( "%" ) _LIBCSTRING_SYSTEM_STRING( PRIu8 ) - _LIBCSTRING_SYSTEM_STRING( " %" ) _LIBCSTRING_SYSTEM_STRING( PRIs_LIBCSTRING_SYSTEM ) - _LIBCSTRING_SYSTEM_STRING( "%" ) _LIBCSTRING_SYSTEM_STRING( PRIs_LIBCSTRING_SYSTEM ), + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIu64 ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIc_SYSTEM ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIu8 ) + _SYSTEM_STRING( " %" ) _SYSTEM_STRING( PRIs_SYSTEM ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIs_SYSTEM ), factored_size, - (libcstring_system_character_t) decimal_point, + (system_character_t) decimal_point, remainder, factor_string, units_string ); } else { - print_count = libcstring_system_string_sprintf( + print_count = system_string_sprintf( byte_size_string, byte_size_string_length, - _LIBCSTRING_SYSTEM_STRING( "%" ) _LIBCSTRING_SYSTEM_STRING( PRIu64 ) - _LIBCSTRING_SYSTEM_STRING( " %" ) _LIBCSTRING_SYSTEM_STRING( PRIs_LIBCSTRING_SYSTEM ) - _LIBCSTRING_SYSTEM_STRING( "%" ) _LIBCSTRING_SYSTEM_STRING( PRIs_LIBCSTRING_SYSTEM ), + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIu64 ) + _SYSTEM_STRING( " %" ) _SYSTEM_STRING( PRIs_SYSTEM ) + _SYSTEM_STRING( "%" ) _SYSTEM_STRING( PRIs_SYSTEM ), factored_size, factor_string, units_string ); @@ -203,7 +205,7 @@ int byte_size_string_create( * Returns 1 if successful or -1 on error */ int byte_size_string_convert( - const libcstring_system_character_t *byte_size_string, + const system_character_t *byte_size_string, size_t byte_size_string_length, uint64_t *size, libcerror_error_t **error ) @@ -253,33 +255,33 @@ int byte_size_string_convert( } while( byte_size_string_iterator < byte_size_string_length ) { - if( ( byte_size_string[ byte_size_string_iterator ] < (libcstring_system_character_t) '0' ) - || ( byte_size_string[ byte_size_string_iterator ] > (libcstring_system_character_t) '9' ) ) + if( ( byte_size_string[ byte_size_string_iterator ] < (system_character_t) '0' ) + || ( byte_size_string[ byte_size_string_iterator ] > (system_character_t) '9' ) ) { break; } byte_size *= 10; - byte_size += ( byte_size_string[ byte_size_string_iterator ] - (libcstring_system_character_t) '0' ); + byte_size += ( byte_size_string[ byte_size_string_iterator ] - (system_character_t) '0' ); byte_size_string_iterator++; } - if( byte_size_string[ byte_size_string_iterator ] == (libcstring_system_character_t) decimal_point ) + if( byte_size_string[ byte_size_string_iterator ] == (system_character_t) decimal_point ) { byte_size_string_iterator++; - if( ( byte_size_string[ byte_size_string_iterator ] >= (libcstring_system_character_t) '0' ) - && ( byte_size_string[ byte_size_string_iterator ] <= (libcstring_system_character_t) '9' ) ) + if( ( byte_size_string[ byte_size_string_iterator ] >= (system_character_t) '0' ) + && ( byte_size_string[ byte_size_string_iterator ] <= (system_character_t) '9' ) ) { - remainder = (int8_t) ( byte_size_string[ byte_size_string_iterator ] - (libcstring_system_character_t) '0' ); + remainder = (int8_t) ( byte_size_string[ byte_size_string_iterator ] - (system_character_t) '0' ); byte_size_string_iterator++; } remainder *= 10; - if( ( byte_size_string[ byte_size_string_iterator ] >= (libcstring_system_character_t) '0' ) - && ( byte_size_string[ byte_size_string_iterator ] <= (libcstring_system_character_t) '9' ) ) + if( ( byte_size_string[ byte_size_string_iterator ] >= (system_character_t) '0' ) + && ( byte_size_string[ byte_size_string_iterator ] <= (system_character_t) '9' ) ) { - remainder += (int8_t) ( byte_size_string[ byte_size_string_iterator ] - (libcstring_system_character_t) '0' ); + remainder += (int8_t) ( byte_size_string[ byte_size_string_iterator ] - (system_character_t) '0' ); byte_size_string_iterator++; } @@ -287,15 +289,15 @@ int byte_size_string_convert( */ while( byte_size_string_iterator < byte_size_string_length ) { - if( ( byte_size_string[ byte_size_string_iterator ] < (libcstring_system_character_t) '0' ) - || ( byte_size_string[ byte_size_string_iterator ] > (libcstring_system_character_t) '9' ) ) + if( ( byte_size_string[ byte_size_string_iterator ] < (system_character_t) '0' ) + || ( byte_size_string[ byte_size_string_iterator ] > (system_character_t) '9' ) ) { break; } byte_size_string_iterator++; } } - if( byte_size_string[ byte_size_string_iterator ] == (libcstring_system_character_t) ' ' ) + if( byte_size_string[ byte_size_string_iterator ] == (system_character_t) ' ' ) { byte_size_string_iterator++; } @@ -353,14 +355,14 @@ int byte_size_string_convert( { units = BYTE_SIZE_STRING_UNIT_MEBIBYTE; } - else if( ( byte_size_string[ byte_size_string_iterator ] == (libcstring_system_character_t) 'i' ) - && ( byte_size_string[ byte_size_string_iterator + 1 ] == (libcstring_system_character_t) 'B' ) ) + else if( ( byte_size_string[ byte_size_string_iterator ] == (system_character_t) 'i' ) + && ( byte_size_string[ byte_size_string_iterator + 1 ] == (system_character_t) 'B' ) ) { units = BYTE_SIZE_STRING_UNIT_MEBIBYTE; byte_size_string_iterator += 2; } - else if( byte_size_string[ byte_size_string_iterator ] == (libcstring_system_character_t) 'B' ) + else if( byte_size_string[ byte_size_string_iterator ] == (system_character_t) 'B' ) { units = BYTE_SIZE_STRING_UNIT_MEGABYTE; @@ -402,9 +404,9 @@ int byte_size_string_convert( #endif #if defined( HAVE_VERBOSE_OUTPUT ) if( ( byte_size_string[ byte_size_string_iterator ] != 0 ) - && ( byte_size_string[ byte_size_string_iterator ] != (libcstring_system_character_t) ' ' ) - && ( byte_size_string[ byte_size_string_iterator ] != (libcstring_system_character_t) '\n' ) - && ( byte_size_string[ byte_size_string_iterator ] != (libcstring_system_character_t) '\r' ) ) + && ( byte_size_string[ byte_size_string_iterator ] != (system_character_t) ' ' ) + && ( byte_size_string[ byte_size_string_iterator ] != (system_character_t) '\n' ) + && ( byte_size_string[ byte_size_string_iterator ] != (system_character_t) '\r' ) ) { libcnotify_printf( "%s: trailing data in byte size string.\n", diff --git a/ewftools/byte_size_string.h b/ewftools/byte_size_string.h index f4a5ce5..328fad4 100644 --- a/ewftools/byte_size_string.h +++ b/ewftools/byte_size_string.h @@ -26,7 +26,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #if defined( __cplusplus ) extern "C" { @@ -39,14 +38,14 @@ enum BYTE_SIZE_STRING_UNITS }; int byte_size_string_create( - libcstring_system_character_t *byte_size_string, + system_character_t *byte_size_string, size_t byte_size_string_length, uint64_t size, int units, libcerror_error_t **error ); int byte_size_string_convert( - const libcstring_system_character_t *byte_size_string, + const system_character_t *byte_size_string, size_t byte_size_string_length, uint64_t *size, libcerror_error_t **error ); diff --git a/ewftools/device_handle.c b/ewftools/device_handle.c index 0647fd8..3f492b2 100644 --- a/ewftools/device_handle.c +++ b/ewftools/device_handle.c @@ -21,13 +21,15 @@ #include #include +#include +#include #include +#include #include "byte_size_string.h" #include "device_handle.h" #include "ewfinput.h" #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_libodraw.h" #include "ewftools_libsmdev.h" @@ -149,7 +151,7 @@ int device_handle_initialize( return( -1 ); } - ( *device_handle )->input_buffer = libcstring_system_string_allocate( + ( *device_handle )->input_buffer = system_string_allocate( DEVICE_HANDLE_INPUT_BUFFER_SIZE ); if( ( *device_handle )->input_buffer == NULL ) @@ -166,7 +168,7 @@ int device_handle_initialize( if( memory_set( ( *device_handle )->input_buffer, 0, - sizeof( libcstring_system_character_t ) * DEVICE_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) + sizeof( system_character_t ) * DEVICE_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) { libcerror_error_set( error, @@ -379,7 +381,7 @@ int device_handle_signal_abort( */ int device_handle_open_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { @@ -410,7 +412,7 @@ int device_handle_open_input( } if( number_of_filenames == 1 ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmdev_check_device_wide( filenames[ 0 ], error ); @@ -505,7 +507,7 @@ int device_handle_open_input( */ int device_handle_open_smdev_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { @@ -568,7 +570,7 @@ int device_handle_open_smdev_input( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libsmdev_handle_open_wide( device_handle->smdev_input_handle, filenames[ 0 ], @@ -608,7 +610,7 @@ int device_handle_open_smdev_input( */ int device_handle_open_odraw_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { @@ -664,7 +666,7 @@ int device_handle_open_odraw_input( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libodraw_handle_open_wide( device_handle->odraw_input_handle, device_handle->toc_filename, @@ -728,7 +730,7 @@ int device_handle_open_odraw_input( return( -1 ); } - filename_length = libcstring_system_string_length( + filename_length = system_string_length( filenames[ data_file_index ] ); if( libodraw_handle_get_data_file( @@ -747,7 +749,7 @@ int device_handle_open_odraw_input( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libodraw_data_file_set_filename_wide( data_file, filenames[ data_file_index ], @@ -822,7 +824,7 @@ int device_handle_open_odraw_input( */ int device_handle_open_smraw_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { @@ -874,7 +876,7 @@ int device_handle_open_smraw_input( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libsmraw_handle_open_wide( device_handle->smraw_input_handle, (wchar_t * const *) filenames, @@ -1169,8 +1171,8 @@ off64_t device_handle_seek_offset( */ int device_handle_prompt_for_string( device_handle_t *device_handle, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **internal_string, + const system_character_t *request_string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { @@ -1220,7 +1222,7 @@ int device_handle_prompt_for_string( } *internal_string_size = DEVICE_HANDLE_STRING_SIZE; - *internal_string = libcstring_system_string_allocate( + *internal_string = system_string_allocate( *internal_string_size ); if( *internal_string == NULL ) @@ -1286,7 +1288,7 @@ int device_handle_prompt_for_string( */ int device_handle_prompt_for_number_of_error_retries( device_handle_t *device_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "device_handle_prompt_for_number_of_error_retries"; @@ -1338,10 +1340,10 @@ int device_handle_prompt_for_number_of_error_retries( */ int device_handle_prompt_for_zero_buffer_on_error( device_handle_t *device_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "device_handle_prompt_for_zero_buffer_on_error"; int result = 0; @@ -1672,7 +1674,7 @@ int device_handle_get_information_value( device_handle_t *device_handle, const uint8_t *information_value_identifier, size_t information_value_identifier_length, - libcstring_system_character_t *information_value, + system_character_t *information_value, size_t information_value_size, libcerror_error_t **error ) { @@ -1692,7 +1694,7 @@ int device_handle_get_information_value( } if( device_handle->type == DEVICE_HANDLE_TYPE_DEVICE ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmdev_handle_get_utf16_information_value( device_handle->smdev_input_handle, information_value_identifier, @@ -1728,7 +1730,7 @@ int device_handle_get_information_value( } else if( device_handle->type == DEVICE_HANDLE_TYPE_FILE ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmraw_handle_get_utf16_information_value( device_handle->smraw_input_handle, information_value_identifier, @@ -2073,8 +2075,8 @@ int device_handle_get_track( */ int device_handle_set_string( device_handle_t *device_handle, - const libcstring_system_character_t *string, - libcstring_system_character_t **internal_string, + const system_character_t *string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { @@ -2133,12 +2135,12 @@ int device_handle_set_string( *internal_string = NULL; *internal_string_size = 0; } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length > 0 ) { - *internal_string = libcstring_system_string_allocate( + *internal_string = system_string_allocate( string_length + 1 ); if( *internal_string == NULL ) @@ -2152,7 +2154,7 @@ int device_handle_set_string( goto on_error; } - if( libcstring_system_string_copy( + if( system_string_copy( *internal_string, string, string_length ) == NULL ) @@ -2190,7 +2192,7 @@ int device_handle_set_string( */ int device_handle_set_number_of_error_retries( device_handle_t *device_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "device_handle_set_number_of_error_retries"; @@ -2209,7 +2211,7 @@ int device_handle_set_number_of_error_retries( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( @@ -2437,7 +2439,7 @@ int device_handle_media_information_fprint( { uint8_t media_information_value[ 64 ]; - libcstring_system_character_t byte_size_string[ 16 ]; + system_character_t byte_size_string[ 16 ]; static char *function = "device_handle_media_information_fprint"; size64_t media_size = 0; @@ -2734,7 +2736,7 @@ int device_handle_media_information_fprint( { fprintf( stream, - "Media size:\t\t\t\t%" PRIs_LIBCSTRING_SYSTEM " (%" PRIu64 " bytes)\n", + "Media size:\t\t\t\t%" PRIs_SYSTEM " (%" PRIu64 " bytes)\n", byte_size_string, media_size ); } diff --git a/ewftools/device_handle.h b/ewftools/device_handle.h index c9837fd..e2d9efd 100644 --- a/ewftools/device_handle.h +++ b/ewftools/device_handle.h @@ -26,7 +26,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "ewftools_libodraw.h" #include "ewftools_libsmdev.h" #include "ewftools_libsmraw.h" @@ -78,7 +77,7 @@ struct device_handle { /* The user input buffer */ - libcstring_system_character_t *input_buffer; + system_character_t *input_buffer; /* The device handle type */ @@ -86,7 +85,7 @@ struct device_handle /* The TOC filename */ - libcstring_system_character_t *toc_filename; + system_character_t *toc_filename; /* The TOC filename size */ @@ -134,25 +133,25 @@ int device_handle_signal_abort( int device_handle_open_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int device_handle_open_smdev_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int device_handle_open_odraw_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int device_handle_open_smraw_input( device_handle_t *device_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); @@ -174,19 +173,19 @@ off64_t device_handle_seek_offset( int device_handle_prompt_for_string( device_handle_t *device_handle, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **internal_string, + const system_character_t *request_string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ); int device_handle_prompt_for_number_of_error_retries( device_handle_t *device_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int device_handle_prompt_for_zero_buffer_on_error( device_handle_t *device_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int device_handle_get_type( @@ -213,7 +212,7 @@ int device_handle_get_information_value( device_handle_t *device_handle, const uint8_t *information_value_identifier, size_t information_value_identifier_length, - libcstring_system_character_t *information_value, + system_character_t *information_value, size_t information_value_size, libcerror_error_t **error ); @@ -244,14 +243,14 @@ int device_handle_get_track( int device_handle_set_string( device_handle_t *device_handle, - const libcstring_system_character_t *string, - libcstring_system_character_t **internal_string, + const system_character_t *string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ); int device_handle_set_number_of_error_retries( device_handle_t *device_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int device_handle_set_error_values( diff --git a/ewftools/digest_hash.c b/ewftools/digest_hash.c index de5e6fe..c3dfb59 100644 --- a/ewftools/digest_hash.c +++ b/ewftools/digest_hash.c @@ -24,7 +24,6 @@ #include "digest_hash.h" #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" /* Converts the EWF digest hash to a printable string * Returns 1 if successful or -1 on error @@ -32,7 +31,7 @@ int digest_hash_copy_to_string( const uint8_t *digest_hash, size_t digest_hash_size, - libcstring_system_character_t *string, + system_character_t *string, size_t string_size, libcerror_error_t **error ) { @@ -106,21 +105,21 @@ int digest_hash_copy_to_string( if( digest_digit <= 9 ) { - string[ string_iterator++ ] = (libcstring_system_character_t) ( (uint8_t) '0' + digest_digit ); + string[ string_iterator++ ] = (system_character_t) ( (uint8_t) '0' + digest_digit ); } else { - string[ string_iterator++ ] = (libcstring_system_character_t) ( (uint8_t) 'a' + ( digest_digit - 10 ) ); + string[ string_iterator++ ] = (system_character_t) ( (uint8_t) 'a' + ( digest_digit - 10 ) ); } digest_digit = digest_hash[ digest_hash_iterator ] % 16; if( digest_digit <= 9 ) { - string[ string_iterator++ ] = (libcstring_system_character_t) ( (uint8_t) '0' + digest_digit ); + string[ string_iterator++ ] = (system_character_t) ( (uint8_t) '0' + digest_digit ); } else { - string[ string_iterator++ ] = (libcstring_system_character_t) ( (uint8_t) 'a' + ( digest_digit - 10 ) ); + string[ string_iterator++ ] = (system_character_t) ( (uint8_t) 'a' + ( digest_digit - 10 ) ); } } string[ string_iterator ] = 0; diff --git a/ewftools/digest_hash.h b/ewftools/digest_hash.h index c0659d8..c623c59 100644 --- a/ewftools/digest_hash.h +++ b/ewftools/digest_hash.h @@ -26,7 +26,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #if defined( __cplusplus ) extern "C" { @@ -35,7 +34,7 @@ extern "C" { int digest_hash_copy_to_string( const uint8_t *digest_hash, size_t digest_hash_size, - libcstring_system_character_t *string, + system_character_t *string, size_t string_size, libcerror_error_t **error ); diff --git a/ewftools/ewfacquire.c b/ewftools/ewfacquire.c index 0126901..cdff67c 100644 --- a/ewftools/ewfacquire.c +++ b/ewftools/ewfacquire.c @@ -21,7 +21,12 @@ #include #include +#include +#include #include +#include + +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -39,7 +44,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -66,10 +70,10 @@ int ewfacquire_abort = 0; void ewfacquire_usage_fprint( FILE *stream ) { - libcstring_system_character_t default_segment_file_size_string[ 16 ]; - libcstring_system_character_t minimum_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_32bit_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_64bit_segment_file_size_string[ 16 ]; + system_character_t default_segment_file_size_string[ 16 ]; + system_character_t minimum_segment_file_size_string[ 16 ]; + system_character_t maximum_32bit_segment_file_size_string[ 16 ]; + system_character_t maximum_64bit_segment_file_size_string[ 16 ]; int result = 0; @@ -170,9 +174,9 @@ void ewfacquire_usage_fprint( if( result == 1 ) { - fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_LIBCSTRING_SYSTEM ")\n" - "\t (minimum is %" PRIs_LIBCSTRING_SYSTEM ", maximum is %" PRIs_LIBCSTRING_SYSTEM " for encase6\n" - "\t and encase7 format and %" PRIs_LIBCSTRING_SYSTEM " for other formats)\n", + fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_SYSTEM ")\n" + "\t (minimum is %" PRIs_SYSTEM ", maximum is %" PRIs_SYSTEM " for encase6\n" + "\t and encase7 format and %" PRIs_SYSTEM " for other formats)\n", default_segment_file_size_string, minimum_segment_file_size_string, maximum_64bit_segment_file_size_string, @@ -267,11 +271,11 @@ void ewfacquire_signal_handler( */ int8_t ewfacquire_confirm_acquiry_parameters( FILE *stream, - libcstring_system_character_t *input_buffer, + system_character_t *input_buffer, size_t input_buffer_size, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; int8_t input_confirmed = -1; int result = 0; @@ -287,7 +291,7 @@ int8_t ewfacquire_confirm_acquiry_parameters( stream, input_buffer, input_buffer_size, - _LIBCSTRING_SYSTEM_STRING( "Continue acquiry with these values" ), + _SYSTEM_STRING( "Continue acquiry with these values" ), ewfinput_yes_no, 2, 0, @@ -793,9 +797,9 @@ int ewfacquire_read_input( } if( process_status_initialize( &process_status, - _LIBCSTRING_SYSTEM_STRING( "Acquiry" ), - _LIBCSTRING_SYSTEM_STRING( "acquired" ), - _LIBCSTRING_SYSTEM_STRING( "Written" ), + _SYSTEM_STRING( "Acquiry" ), + _SYSTEM_STRING( "acquired" ), + _SYSTEM_STRING( "Written" ), stdout, print_status_information, error ) != 1 ) @@ -1270,47 +1274,47 @@ int ewfacquire_read_input( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { - libcstring_system_character_t input_buffer[ EWFACQUIRE_INPUT_BUFFER_SIZE ]; - libcstring_system_character_t media_information_model[ 64 ]; - libcstring_system_character_t media_information_serial_number[ 64 ]; + system_character_t input_buffer[ EWFACQUIRE_INPUT_BUFFER_SIZE ]; + system_character_t media_information_model[ 64 ]; + system_character_t media_information_serial_number[ 64 ]; libcerror_error_t *error = NULL; - libcstring_system_character_t *log_filename = NULL; - libcstring_system_character_t *option_additional_digest_types = NULL; - libcstring_system_character_t *option_bytes_per_sector = NULL; - libcstring_system_character_t *option_case_number = NULL; - libcstring_system_character_t *option_compression_values = NULL; - libcstring_system_character_t *option_description = NULL; - libcstring_system_character_t *option_examiner_name = NULL; - libcstring_system_character_t *option_evidence_number = NULL; - libcstring_system_character_t *option_format = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *option_maximum_segment_size = NULL; - libcstring_system_character_t *option_media_flags = NULL; - libcstring_system_character_t *option_media_type = NULL; - libcstring_system_character_t *option_notes = NULL; - libcstring_system_character_t *option_number_of_error_retries = NULL; - libcstring_system_character_t *option_offset = NULL; - libcstring_system_character_t *option_process_buffer_size = NULL; - libcstring_system_character_t *option_secondary_target_filename = NULL; - libcstring_system_character_t *option_sector_error_granularity = NULL; - libcstring_system_character_t *option_sectors_per_chunk = NULL; - libcstring_system_character_t *option_size = NULL; - libcstring_system_character_t *option_target_filename = NULL; - libcstring_system_character_t *option_toc_filename = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfacquire" ); - libcstring_system_character_t *request_string = NULL; + system_character_t *log_filename = NULL; + system_character_t *option_additional_digest_types = NULL; + system_character_t *option_bytes_per_sector = NULL; + system_character_t *option_case_number = NULL; + system_character_t *option_compression_values = NULL; + system_character_t *option_description = NULL; + system_character_t *option_examiner_name = NULL; + system_character_t *option_evidence_number = NULL; + system_character_t *option_format = NULL; + system_character_t *option_header_codepage = NULL; + system_character_t *option_maximum_segment_size = NULL; + system_character_t *option_media_flags = NULL; + system_character_t *option_media_type = NULL; + system_character_t *option_notes = NULL; + system_character_t *option_number_of_error_retries = NULL; + system_character_t *option_offset = NULL; + system_character_t *option_process_buffer_size = NULL; + system_character_t *option_secondary_target_filename = NULL; + system_character_t *option_sector_error_granularity = NULL; + system_character_t *option_sectors_per_chunk = NULL; + system_character_t *option_size = NULL; + system_character_t *option_target_filename = NULL; + system_character_t *option_toc_filename = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfacquire" ); + system_character_t *request_string = NULL; log_handle_t *log_handle = NULL; - libcstring_system_integer_t option = 0; + system_integer_t option = 0; off64_t resume_acquiry_offset = 0; size_t string_length = 0; uint8_t calculate_md5 = 1; @@ -1357,11 +1361,11 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:b:B:c:C:d:D:e:E:f:g:hl:m:M:N:o:p:P:qr:RsS:t:T:uvVwx2:" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:b:B:c:C:d:D:e:E:f:g:hl:m:M:N:o:p:P:qr:RsS:t:T:uvVwx2:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: ewftools_output_version_fprint( stdout, @@ -1369,7 +1373,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); ewfacquire_usage_fprint( @@ -1377,62 +1381,62 @@ int main( int argc, char * const argv[] ) goto on_error; - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'b': + case (system_integer_t) 'b': option_sectors_per_chunk = optarg; break; - case (libcstring_system_integer_t) 'B': + case (system_integer_t) 'B': option_size = optarg; break; - case (libcstring_system_integer_t) 'c': + case (system_integer_t) 'c': option_compression_values = optarg; break; - case (libcstring_system_integer_t) 'C': + case (system_integer_t) 'C': option_case_number = optarg; break; - case (libcstring_system_integer_t) 'd': + case (system_integer_t) 'd': option_additional_digest_types = optarg; break; - case (libcstring_system_integer_t) 'D': + case (system_integer_t) 'D': option_description = optarg; break; - case (libcstring_system_integer_t) 'e': + case (system_integer_t) 'e': option_examiner_name = optarg; break; - case (libcstring_system_integer_t) 'E': + case (system_integer_t) 'E': option_evidence_number = optarg; break; - case (libcstring_system_integer_t) 'f': + case (system_integer_t) 'f': option_format = optarg; break; - case (libcstring_system_integer_t) 'g': + case (system_integer_t) 'g': option_sector_error_granularity = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); @@ -1442,87 +1446,87 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'l': + case (system_integer_t) 'l': log_filename = optarg; break; - case (libcstring_system_integer_t) 'm': + case (system_integer_t) 'm': option_media_type = optarg; break; - case (libcstring_system_integer_t) 'M': + case (system_integer_t) 'M': option_media_flags = optarg; break; - case (libcstring_system_integer_t) 'N': + case (system_integer_t) 'N': option_notes = optarg; break; - case (libcstring_system_integer_t) 'o': + case (system_integer_t) 'o': option_offset = optarg; break; - case (libcstring_system_integer_t) 'p': + case (system_integer_t) 'p': option_process_buffer_size = optarg; break; - case (libcstring_system_integer_t) 'P': + case (system_integer_t) 'P': option_bytes_per_sector = optarg; break; - case (libcstring_system_integer_t) 'q': + case (system_integer_t) 'q': print_status_information = 0; break; - case (libcstring_system_integer_t) 'r': + case (system_integer_t) 'r': option_number_of_error_retries = optarg; break; - case (libcstring_system_integer_t) 'R': + case (system_integer_t) 'R': resume_acquiry = 1; break; - case (libcstring_system_integer_t) 's': + case (system_integer_t) 's': swap_byte_pairs = 1; break; - case (libcstring_system_integer_t) 'S': + case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; - case (libcstring_system_integer_t) 't': + case (system_integer_t) 't': option_target_filename = optarg; break; - case (libcstring_system_integer_t) 'T': + case (system_integer_t) 'T': option_toc_filename = optarg; break; - case (libcstring_system_integer_t) 'u': + case (system_integer_t) 'u': interactive_mode = 0; break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); @@ -1532,17 +1536,17 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'w': + case (system_integer_t) 'w': zero_buffer_on_error = 1; break; - case (libcstring_system_integer_t) 'x': + case (system_integer_t) 'x': use_chunk_data_functions = 1; break; - case (libcstring_system_integer_t) '2': + case (system_integer_t) '2': option_secondary_target_filename = optarg; break; @@ -1580,9 +1584,9 @@ int main( int argc, char * const argv[] ) /* Check if to read from stdin */ - if( libcstring_system_string_compare( + if( system_string_compare( argv[ optind ], - _LIBCSTRING_SYSTEM_STRING( "-" ), + _SYSTEM_STRING( "-" ), 1 ) == 0 ) { fprintf( @@ -1594,13 +1598,13 @@ int main( int argc, char * const argv[] ) if( ( option_target_filename != NULL ) && ( option_secondary_target_filename != NULL ) ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_secondary_target_filename ); - if( libcstring_system_string_length( + if( system_string_length( option_target_filename ) == string_length ) { - if( libcstring_system_string_compare( + if( system_string_compare( option_target_filename, option_secondary_target_filename, string_length ) == 0 ) @@ -1763,7 +1767,7 @@ int main( int argc, char * const argv[] ) */ if( imaging_handle_set_string( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "image" ), + _SYSTEM_STRING( "image" ), &( ewfacquire_imaging_handle->target_filename ), &( ewfacquire_imaging_handle->target_filename_size ), &error ) != 1 ) @@ -2185,11 +2189,11 @@ int main( int argc, char * const argv[] ) if( resume_acquiry != 0 ) { - request_string = _LIBCSTRING_SYSTEM_STRING( "Image path and filename with extension" ); + request_string = _SYSTEM_STRING( "Image path and filename with extension" ); } else if( option_target_filename == NULL ) { - request_string = _LIBCSTRING_SYSTEM_STRING( "Image path and filename without extension" ); + request_string = _SYSTEM_STRING( "Image path and filename without extension" ); } if( request_string != NULL ) { @@ -2315,7 +2319,7 @@ int main( int argc, char * const argv[] ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Case number" ), + _SYSTEM_STRING( "Case number" ), &( ewfacquire_imaging_handle->case_number ), &( ewfacquire_imaging_handle->case_number_size ), &error ) == -1 ) @@ -2331,7 +2335,7 @@ int main( int argc, char * const argv[] ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Description" ), + _SYSTEM_STRING( "Description" ), &( ewfacquire_imaging_handle->description ), &( ewfacquire_imaging_handle->description_size ), &error ) == -1 ) @@ -2347,7 +2351,7 @@ int main( int argc, char * const argv[] ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Evidence number" ), + _SYSTEM_STRING( "Evidence number" ), &( ewfacquire_imaging_handle->evidence_number ), &( ewfacquire_imaging_handle->evidence_number_size ), &error ) == -1 ) @@ -2363,7 +2367,7 @@ int main( int argc, char * const argv[] ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Examiner name" ), + _SYSTEM_STRING( "Examiner name" ), &( ewfacquire_imaging_handle->examiner_name ), &( ewfacquire_imaging_handle->examiner_name_size ), &error ) == -1 ) @@ -2379,7 +2383,7 @@ int main( int argc, char * const argv[] ) { if( imaging_handle_prompt_for_string( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Notes" ), + _SYSTEM_STRING( "Notes" ), &( ewfacquire_imaging_handle->notes ), &( ewfacquire_imaging_handle->notes_size ), &error ) == -1 ) @@ -2395,7 +2399,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_media_type( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Media type" ), + _SYSTEM_STRING( "Media type" ), &error ); if( result == -1 ) @@ -2411,7 +2415,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_media_flags( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Media characteristics" ), + _SYSTEM_STRING( "Media characteristics" ), &error ); if( result == -1 ) @@ -2427,7 +2431,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_format( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Use EWF file format" ), + _SYSTEM_STRING( "Use EWF file format" ), &error ); if( result == -1 ) @@ -2443,7 +2447,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_compression_method( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Compression method" ), + _SYSTEM_STRING( "Compression method" ), &error ); if( result == -1 ) @@ -2456,7 +2460,7 @@ int main( int argc, char * const argv[] ) } result = imaging_handle_prompt_for_compression_level( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Compression level" ), + _SYSTEM_STRING( "Compression level" ), &error ); if( result == -1 ) @@ -2476,7 +2480,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_acquiry_offset( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Start to acquire at offset" ), + _SYSTEM_STRING( "Start to acquire at offset" ), &error ); if( result == -1 ) @@ -2499,7 +2503,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_acquiry_size( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "The number of bytes to acquire" ), + _SYSTEM_STRING( "The number of bytes to acquire" ), &error ); if( result == -1 ) @@ -2519,7 +2523,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_maximum_segment_size( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "Evidence segment file size in bytes" ), + _SYSTEM_STRING( "Evidence segment file size in bytes" ), &error ); if( result == -1 ) @@ -2548,7 +2552,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_bytes_per_sector( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "The number of bytes per sector" ), + _SYSTEM_STRING( "The number of bytes per sector" ), &error ); if( result == -1 ) @@ -2564,7 +2568,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_sectors_per_chunk( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "The number of sectors to read at once" ), + _SYSTEM_STRING( "The number of sectors to read at once" ), &error ); if( result == -1 ) @@ -2580,7 +2584,7 @@ int main( int argc, char * const argv[] ) { result = imaging_handle_prompt_for_sector_error_granularity( ewfacquire_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "The number of sectors to be used as error granularity" ), + _SYSTEM_STRING( "The number of sectors to be used as error granularity" ), &error ); if( result == -1 ) @@ -2606,7 +2610,7 @@ int main( int argc, char * const argv[] ) { result = device_handle_prompt_for_number_of_error_retries( ewfacquire_device_handle, - _LIBCSTRING_SYSTEM_STRING( "The number of retries when a read error occurs" ), + _SYSTEM_STRING( "The number of retries when a read error occurs" ), &error ); if( result == -1 ) @@ -2622,7 +2626,7 @@ int main( int argc, char * const argv[] ) { result = device_handle_prompt_for_zero_buffer_on_error( ewfacquire_device_handle, - _LIBCSTRING_SYSTEM_STRING( "Wipe sectors on read error (mimic EnCase like behavior)" ), + _SYSTEM_STRING( "Wipe sectors on read error (mimic EnCase like behavior)" ), &error ); if( result == -1 ) @@ -2815,7 +2819,7 @@ int main( int argc, char * const argv[] ) if( imaging_handle_set_output_values( ewfacquire_imaging_handle, program, - _LIBCSTRING_SYSTEM_STRING( LIBEWF_VERSION_STRING ), + _SYSTEM_STRING( LIBEWF_VERSION_STRING ), media_information_model, media_information_serial_number, &error ) != 1 ) @@ -2873,7 +2877,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to open log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -2980,7 +2984,7 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); @@ -2989,14 +2993,14 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": FAILURE\n", + "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": SUCCESS\n", + "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); diff --git a/ewftools/ewfacquirestream.c b/ewftools/ewfacquirestream.c index 6ea267d..ae1c778 100644 --- a/ewftools/ewfacquirestream.c +++ b/ewftools/ewfacquirestream.c @@ -21,20 +21,29 @@ #include #include +#include +#include #include +#include + +#include #if defined( HAVE_ERRNO_H ) || defined( WINAPI ) #include #endif -#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) -#include +#if defined( HAVE_FCNTL_H ) || defined( WINAPI ) +#include #endif #if defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + #include "byte_size_string.h" #include "ewfcommon.h" #include "ewfinput.h" @@ -42,7 +51,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -60,10 +68,10 @@ int ewfacquirestream_abort = 0; void usage_fprint( FILE *stream ) { - libcstring_system_character_t default_segment_file_size_string[ 16 ]; - libcstring_system_character_t minimum_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_32bit_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_64bit_segment_file_size_string[ 16 ]; + system_character_t default_segment_file_size_string[ 16 ]; + system_character_t minimum_segment_file_size_string[ 16 ]; + system_character_t maximum_32bit_segment_file_size_string[ 16 ]; + system_character_t maximum_64bit_segment_file_size_string[ 16 ]; int result = 0; @@ -160,9 +168,9 @@ void usage_fprint( if( result == 1 ) { - fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_LIBCSTRING_SYSTEM ")\n" - "\t (minimum is %" PRIs_LIBCSTRING_SYSTEM ", maximum is %" PRIs_LIBCSTRING_SYSTEM " for encase6 and\n" - "\t encase7 format and %" PRIs_LIBCSTRING_SYSTEM " for other formats)\n", + fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_SYSTEM ")\n" + "\t (minimum is %" PRIs_SYSTEM ", maximum is %" PRIs_SYSTEM " for encase6 and\n" + "\t encase7 format and %" PRIs_SYSTEM " for other formats)\n", default_segment_file_size_string, minimum_segment_file_size_string, maximum_64bit_segment_file_size_string, @@ -607,9 +615,9 @@ int ewfacquirestream_read_input( } if( process_status_initialize( &process_status, - _LIBCSTRING_SYSTEM_STRING( "Acquiry" ), - _LIBCSTRING_SYSTEM_STRING( "acquired" ), - _LIBCSTRING_SYSTEM_STRING( "Written" ), + _SYSTEM_STRING( "Acquiry" ), + _SYSTEM_STRING( "acquired" ), + _SYSTEM_STRING( "Written" ), stdout, print_status_information, error ) != 1 ) @@ -934,7 +942,7 @@ int ewfacquirestream_read_input( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -942,31 +950,31 @@ int main( int argc, char * const argv[] ) { libcerror_error_t *error = NULL; - libcstring_system_character_t *log_filename = NULL; - libcstring_system_character_t *option_additional_digest_types = NULL; - libcstring_system_character_t *option_bytes_per_sector = NULL; - libcstring_system_character_t *option_case_number = NULL; - libcstring_system_character_t *option_compression_values = NULL; - libcstring_system_character_t *option_description = NULL; - libcstring_system_character_t *option_examiner_name = NULL; - libcstring_system_character_t *option_evidence_number = NULL; - libcstring_system_character_t *option_format = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *option_maximum_segment_size = NULL; - libcstring_system_character_t *option_media_flags = NULL; - libcstring_system_character_t *option_media_type = NULL; - libcstring_system_character_t *option_notes = NULL; - libcstring_system_character_t *option_offset = NULL; - libcstring_system_character_t *option_process_buffer_size = NULL; - libcstring_system_character_t *option_secondary_target_filename = NULL; - libcstring_system_character_t *option_sectors_per_chunk = NULL; - libcstring_system_character_t *option_size = NULL; - libcstring_system_character_t *option_target_filename = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfacquirestream" ); + system_character_t *log_filename = NULL; + system_character_t *option_additional_digest_types = NULL; + system_character_t *option_bytes_per_sector = NULL; + system_character_t *option_case_number = NULL; + system_character_t *option_compression_values = NULL; + system_character_t *option_description = NULL; + system_character_t *option_examiner_name = NULL; + system_character_t *option_evidence_number = NULL; + system_character_t *option_format = NULL; + system_character_t *option_header_codepage = NULL; + system_character_t *option_maximum_segment_size = NULL; + system_character_t *option_media_flags = NULL; + system_character_t *option_media_type = NULL; + system_character_t *option_notes = NULL; + system_character_t *option_offset = NULL; + system_character_t *option_process_buffer_size = NULL; + system_character_t *option_secondary_target_filename = NULL; + system_character_t *option_sectors_per_chunk = NULL; + system_character_t *option_size = NULL; + system_character_t *option_target_filename = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfacquirestream" ); log_handle_t *log_handle = NULL; - libcstring_system_integer_t option = 0; + system_integer_t option = 0; size_t string_length = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; @@ -1037,11 +1045,11 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:b:B:c:C:d:D:e:E:f:hl:m:M:N:o:p:P:qsS:t:vVx2:" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:b:B:c:C:d:D:e:E:f:hl:m:M:N:o:p:P:qsS:t:vVx2:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: ewftools_output_version_fprint( stdout, @@ -1049,7 +1057,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( @@ -1057,57 +1065,57 @@ int main( int argc, char * const argv[] ) goto on_error; - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'b': + case (system_integer_t) 'b': option_sectors_per_chunk = optarg; break; - case (libcstring_system_integer_t) 'B': + case (system_integer_t) 'B': option_size = optarg; break; - case (libcstring_system_integer_t) 'c': + case (system_integer_t) 'c': option_compression_values = optarg; break; - case (libcstring_system_integer_t) 'C': + case (system_integer_t) 'C': option_case_number = optarg; break; - case (libcstring_system_integer_t) 'd': + case (system_integer_t) 'd': option_additional_digest_types = optarg; break; - case (libcstring_system_integer_t) 'D': + case (system_integer_t) 'D': option_description = optarg; break; - case (libcstring_system_integer_t) 'e': + case (system_integer_t) 'e': option_examiner_name = optarg; break; - case (libcstring_system_integer_t) 'E': + case (system_integer_t) 'E': option_evidence_number = optarg; break; - case (libcstring_system_integer_t) 'f': + case (system_integer_t) 'f': option_format = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); @@ -1117,67 +1125,67 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'l': + case (system_integer_t) 'l': log_filename = optarg; break; - case (libcstring_system_integer_t) 'm': + case (system_integer_t) 'm': option_media_type = optarg; break; - case (libcstring_system_integer_t) 'M': + case (system_integer_t) 'M': option_media_flags = optarg; break; - case (libcstring_system_integer_t) 'N': + case (system_integer_t) 'N': option_notes = optarg; break; - case (libcstring_system_integer_t) 'o': + case (system_integer_t) 'o': option_offset = optarg; break; - case (libcstring_system_integer_t) 'p': + case (system_integer_t) 'p': option_process_buffer_size = optarg; break; - case (libcstring_system_integer_t) 'P': + case (system_integer_t) 'P': option_bytes_per_sector = optarg; break; - case (libcstring_system_integer_t) 'q': + case (system_integer_t) 'q': print_status_information = 0; break; - case (libcstring_system_integer_t) 's': + case (system_integer_t) 's': swap_byte_pairs = 1; break; - case (libcstring_system_integer_t) 'S': + case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; - case (libcstring_system_integer_t) 't': + case (system_integer_t) 't': option_target_filename = optarg; break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); @@ -1187,12 +1195,12 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'x': + case (system_integer_t) 'x': use_chunk_data_functions = 1; break; - case (libcstring_system_integer_t) '2': + case (system_integer_t) '2': option_secondary_target_filename = optarg; break; @@ -1216,13 +1224,13 @@ int main( int argc, char * const argv[] ) if( ( option_target_filename != NULL ) && ( option_secondary_target_filename != NULL ) ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_secondary_target_filename ); - if( libcstring_system_string_length( + if( system_string_length( option_target_filename ) == string_length ) { - if( libcstring_system_string_compare( + if( system_string_compare( option_target_filename, option_secondary_target_filename, string_length ) == 0 ) @@ -1291,7 +1299,7 @@ int main( int argc, char * const argv[] ) */ if( imaging_handle_set_string( ewfacquirestream_imaging_handle, - _LIBCSTRING_SYSTEM_STRING( "image" ), + _SYSTEM_STRING( "image" ), &( ewfacquirestream_imaging_handle->target_filename ), &( ewfacquirestream_imaging_handle->target_filename_size ), &error ) != 1 ) @@ -1321,7 +1329,7 @@ int main( int argc, char * const argv[] ) } if( option_case_number == NULL ) { - option_case_number = _LIBCSTRING_SYSTEM_STRING( "case_number" ); + option_case_number = _SYSTEM_STRING( "case_number" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1338,7 +1346,7 @@ int main( int argc, char * const argv[] ) } if( option_description == NULL ) { - option_description = _LIBCSTRING_SYSTEM_STRING( "description" ); + option_description = _SYSTEM_STRING( "description" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1355,7 +1363,7 @@ int main( int argc, char * const argv[] ) } if( option_evidence_number == NULL ) { - option_evidence_number = _LIBCSTRING_SYSTEM_STRING( "evidence_number" ); + option_evidence_number = _SYSTEM_STRING( "evidence_number" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1372,7 +1380,7 @@ int main( int argc, char * const argv[] ) } if( option_examiner_name == NULL ) { - option_examiner_name = _LIBCSTRING_SYSTEM_STRING( "examiner_name" ); + option_examiner_name = _SYSTEM_STRING( "examiner_name" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1389,7 +1397,7 @@ int main( int argc, char * const argv[] ) } if( option_notes == NULL ) { - option_notes = _LIBCSTRING_SYSTEM_STRING( "notes" ); + option_notes = _SYSTEM_STRING( "notes" ); } if( imaging_handle_set_string( ewfacquirestream_imaging_handle, @@ -1702,7 +1710,7 @@ int main( int argc, char * const argv[] ) if( imaging_handle_set_output_values( ewfacquirestream_imaging_handle, program, - _LIBCSTRING_SYSTEM_STRING( LIBEWF_VERSION_STRING ), + _SYSTEM_STRING( LIBEWF_VERSION_STRING ), NULL, NULL, &error ) != 1 ) @@ -1745,7 +1753,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to open log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -1831,7 +1839,7 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); @@ -1840,14 +1848,14 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": FAILURE\n", + "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": SUCCESS\n", + "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); diff --git a/ewftools/ewfdebug.c b/ewftools/ewfdebug.c index 41515a2..bec196c 100644 --- a/ewftools/ewfdebug.c +++ b/ewftools/ewfdebug.c @@ -21,7 +21,12 @@ #include #include +#include +#include #include +#include + +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -41,7 +46,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -122,7 +126,7 @@ void ewfdebug_signal_handler( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -134,13 +138,13 @@ int main( int argc, char * const argv[] ) libcerror_error_t *error = NULL; - libcstring_system_character_t * const *argv_filenames = NULL; - libcstring_system_character_t **ewf_filenames = NULL; + system_character_t * const *argv_filenames = NULL; + system_character_t **ewf_filenames = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfdebug" ); + system_character_t *option_header_codepage = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfdebug" ); - libcstring_system_integer_t option = 0; + system_integer_t option = 0; size_t first_filename_length = 0; uint8_t verbose = 0; int number_of_filenames = 0; @@ -180,11 +184,11 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:hqvV" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:hqvV" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: ewftools_output_version_fprint( stdout, @@ -192,7 +196,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); usage_fprint( @@ -200,12 +204,12 @@ int main( int argc, char * const argv[] ) return( EXIT_FAILURE ); - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); @@ -215,15 +219,15 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'q': + case (system_integer_t) 'q': break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); @@ -338,10 +342,10 @@ int main( int argc, char * const argv[] ) if( number_of_filenames == 1 ) { - first_filename_length = libcstring_system_string_length( + first_filename_length = system_string_length( argv_filenames[ 0 ] ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( argv_filenames[ 0 ], first_filename_length, @@ -365,7 +369,7 @@ int main( int argc, char * const argv[] ) goto on_error; } - argv_filenames = (libcstring_system_character_t * const *) ewf_filenames; + argv_filenames = (system_character_t * const *) ewf_filenames; } if( libewf_handle_initialize( &ewfdebug_input_handle, @@ -377,13 +381,21 @@ int main( int argc, char * const argv[] ) goto on_error; } +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + result = libewf_handle_open_wide( + ewfdebug_input_handle, + argv_filenames, + number_of_filenames, + LIBEWF_OPEN_READ_WRITE, + &error ); +#else result = libewf_handle_open( ewfdebug_input_handle, argv_filenames, number_of_filenames, LIBEWF_OPEN_READ_WRITE, &error ); - +#endif #if !defined( HAVE_GLOB_H ) if( ewftools_glob_free( &glob, @@ -464,7 +476,7 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); diff --git a/ewftools/ewfexport.c b/ewftools/ewfexport.c index a806e3c..2c399d4 100644 --- a/ewftools/ewfexport.c +++ b/ewftools/ewfexport.c @@ -21,20 +21,27 @@ #include #include +#include #include +#include + #if defined( HAVE_SYS_RESOURCE_H ) #include #endif -#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) -#include -#endif - #if defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif +#if defined( HAVE_FCNTL_H ) || defined( WINAPI ) +#include +#endif + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + #if defined( HAVE_GLOB_H ) #include #endif @@ -47,7 +54,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -67,10 +73,10 @@ int ewfexport_abort = 0; void usage_fprint( FILE *stream ) { - libcstring_system_character_t default_segment_file_size_string[ 16 ]; - libcstring_system_character_t minimum_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_32bit_segment_file_size_string[ 16 ]; - libcstring_system_character_t maximum_64bit_segment_file_size_string[ 16 ]; + system_character_t default_segment_file_size_string[ 16 ]; + system_character_t minimum_segment_file_size_string[ 16 ]; + system_character_t maximum_32bit_segment_file_size_string[ 16 ]; + system_character_t maximum_64bit_segment_file_size_string[ 16 ]; int result = 0; @@ -155,9 +161,9 @@ void usage_fprint( if( result == 1 ) { - fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_LIBCSTRING_SYSTEM ")\n" - "\t (minimum is %" PRIs_LIBCSTRING_SYSTEM ", maximum is %" PRIs_LIBCSTRING_SYSTEM " for raw, encase6\n" - "\t and encase7 format and %" PRIs_LIBCSTRING_SYSTEM " for other formats)\n" + fprintf( stream, "\t-S: specify the segment file size in bytes (default is %" PRIs_SYSTEM ")\n" + "\t (minimum is %" PRIs_SYSTEM ", maximum is %" PRIs_SYSTEM " for raw, encase6\n" + "\t and encase7 format and %" PRIs_SYSTEM " for other formats)\n" "\t (not used for files format)\n", default_segment_file_size_string, minimum_segment_file_size_string, @@ -233,7 +239,7 @@ void ewfexport_signal_handler( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -242,9 +248,9 @@ int main( int argc, char * const argv[] ) #if defined( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif - libcstring_system_character_t acquiry_operating_system[ 32 ]; + system_character_t acquiry_operating_system[ 32 ]; - libcstring_system_character_t * const *argv_filenames = NULL; + system_character_t * const *argv_filenames = NULL; libcerror_error_t *error = NULL; @@ -252,24 +258,24 @@ int main( int argc, char * const argv[] ) ewftools_glob_t *glob = NULL; #endif - libcstring_system_character_t *acquiry_software_version = NULL; - libcstring_system_character_t *log_filename = NULL; - libcstring_system_character_t *option_additional_digest_types = NULL; - libcstring_system_character_t *option_compression_values = NULL; - libcstring_system_character_t *option_format = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *option_maximum_segment_size = NULL; - libcstring_system_character_t *option_offset = NULL; - libcstring_system_character_t *option_process_buffer_size = NULL; - libcstring_system_character_t *option_sectors_per_chunk = NULL; - libcstring_system_character_t *option_size = NULL; - libcstring_system_character_t *option_target_path = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfexport" ); - libcstring_system_character_t *request_string = NULL; + system_character_t *acquiry_software_version = NULL; + system_character_t *log_filename = NULL; + system_character_t *option_additional_digest_types = NULL; + system_character_t *option_compression_values = NULL; + system_character_t *option_format = NULL; + system_character_t *option_header_codepage = NULL; + system_character_t *option_maximum_segment_size = NULL; + system_character_t *option_offset = NULL; + system_character_t *option_process_buffer_size = NULL; + system_character_t *option_sectors_per_chunk = NULL; + system_character_t *option_size = NULL; + system_character_t *option_target_path = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfexport" ); + system_character_t *request_string = NULL; log_handle_t *log_handle = NULL; - libcstring_system_integer_t option = 0; + system_integer_t option = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t swap_byte_pairs = 0; @@ -337,11 +343,11 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:b:B:c:d:f:hl:o:p:qsS:t:uvVwx" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:b:B:c:d:f:hl:o:p:qsS:t:uvVwx" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: ewftools_output_version_fprint( stderr, @@ -349,7 +355,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); usage_fprint( @@ -357,37 +363,37 @@ int main( int argc, char * const argv[] ) goto on_error; - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'b': + case (system_integer_t) 'b': option_sectors_per_chunk = optarg; break; - case (libcstring_system_integer_t) 'B': + case (system_integer_t) 'B': option_size = optarg; break; - case (libcstring_system_integer_t) 'c': + case (system_integer_t) 'c': option_compression_values = optarg; break; - case (libcstring_system_integer_t) 'd': + case (system_integer_t) 'd': option_additional_digest_types = optarg; break; - case (libcstring_system_integer_t) 'f': + case (system_integer_t) 'f': option_format = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': ewftools_output_version_fprint( stderr, program ); @@ -397,52 +403,52 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'l': + case (system_integer_t) 'l': log_filename = optarg; break; - case (libcstring_system_integer_t) 'o': + case (system_integer_t) 'o': option_offset = optarg; break; - case (libcstring_system_integer_t) 'p': + case (system_integer_t) 'p': option_process_buffer_size = optarg; break; - case (libcstring_system_integer_t) 'q': + case (system_integer_t) 'q': print_status_information = 0; break; - case (libcstring_system_integer_t) 's': + case (system_integer_t) 's': swap_byte_pairs = 1; break; - case (libcstring_system_integer_t) 'S': + case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; - case (libcstring_system_integer_t) 't': + case (system_integer_t) 't': option_target_path = optarg; break; - case (libcstring_system_integer_t) 'u': + case (system_integer_t) 'u': interactive_mode = 0; break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_version_fprint( stderr, program ); @@ -452,12 +458,12 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'w': + case (system_integer_t) 'w': zero_chunk_on_error = 1; break; - case (libcstring_system_integer_t) 'x': + case (system_integer_t) 'x': use_chunk_data_functions = 1; break; @@ -661,7 +667,7 @@ int main( int argc, char * const argv[] ) */ if( export_handle_set_string( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "export" ), + _SYSTEM_STRING( "export" ), &( ewfexport_export_handle->target_path ), &( ewfexport_export_handle->target_path_size ), &error ) != 1 ) @@ -882,7 +888,7 @@ int main( int argc, char * const argv[] ) { result = export_handle_prompt_for_output_format( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "Export to format" ), + _SYSTEM_STRING( "Export to format" ), &error ); if( result == -1 ) @@ -898,15 +904,15 @@ int main( int argc, char * const argv[] ) { if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { - request_string = _LIBCSTRING_SYSTEM_STRING( "Target path and filename without extension" ); + request_string = _SYSTEM_STRING( "Target path and filename without extension" ); } else if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_FILES ) { - request_string = _LIBCSTRING_SYSTEM_STRING( "Target path" ); + request_string = _SYSTEM_STRING( "Target path" ); } else if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { - request_string = _LIBCSTRING_SYSTEM_STRING( "Target path and filename without extension or - for stdout" ); + request_string = _SYSTEM_STRING( "Target path and filename without extension or - for stdout" ); } } if( request_string != NULL ) @@ -943,7 +949,7 @@ int main( int argc, char * const argv[] ) { result = export_handle_prompt_for_compression_method( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "Compression method" ), + _SYSTEM_STRING( "Compression method" ), &error ); if( result == -1 ) @@ -956,7 +962,7 @@ int main( int argc, char * const argv[] ) } result = export_handle_prompt_for_compression_level( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "Compression level" ), + _SYSTEM_STRING( "Compression level" ), &error ); if( result == -1 ) @@ -972,7 +978,7 @@ int main( int argc, char * const argv[] ) { result = export_handle_prompt_for_maximum_segment_size( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "Evidence segment file size in bytes" ), + _SYSTEM_STRING( "Evidence segment file size in bytes" ), &error ); if( result == -1 ) @@ -1001,7 +1007,7 @@ int main( int argc, char * const argv[] ) { result = export_handle_prompt_for_sectors_per_chunk( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "The number of sectors to read at once" ), + _SYSTEM_STRING( "The number of sectors to read at once" ), &error ); if( result == -1 ) @@ -1017,7 +1023,7 @@ int main( int argc, char * const argv[] ) else if( ewfexport_export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { if( ( ewfexport_export_handle->target_path != NULL ) - && ( ( ewfexport_export_handle->target_path )[ 0 ] == (libcstring_system_character_t) '-' ) + && ( ( ewfexport_export_handle->target_path )[ 0 ] == (system_character_t) '-' ) && ( ( ewfexport_export_handle->target_path )[ 1 ] == 0 ) ) { /* No need for segment files when exporting to stdout */ @@ -1026,7 +1032,7 @@ int main( int argc, char * const argv[] ) { result = export_handle_prompt_for_maximum_segment_size( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "Evidence segment file size in bytes (0 is unlimited)" ), + _SYSTEM_STRING( "Evidence segment file size in bytes (0 is unlimited)" ), &error ); if( result == -1 ) @@ -1056,7 +1062,7 @@ int main( int argc, char * const argv[] ) { result = export_handle_prompt_for_export_offset( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "Start export at offset" ), + _SYSTEM_STRING( "Start export at offset" ), &error ); if( result == -1 ) @@ -1076,7 +1082,7 @@ int main( int argc, char * const argv[] ) { result = export_handle_prompt_for_export_size( ewfexport_export_handle, - _LIBCSTRING_SYSTEM_STRING( "Number of bytes to export" ), + _SYSTEM_STRING( "Number of bytes to export" ), &error ); if( result == -1 ) @@ -1151,7 +1157,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to open log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -1207,7 +1213,7 @@ int main( int argc, char * const argv[] ) acquiry_operating_system[ 0 ] = 0; } - acquiry_software_version = _LIBCSTRING_SYSTEM_STRING( LIBEWF_VERSION_STRING ); + acquiry_software_version = _SYSTEM_STRING( LIBEWF_VERSION_STRING ); if( export_handle_set_output_values( ewfexport_export_handle, @@ -1251,7 +1257,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to close log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to close log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -1304,7 +1310,7 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); @@ -1313,14 +1319,14 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": FAILURE\n", + "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": SUCCESS\n", + "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); diff --git a/ewftools/ewfinfo.c b/ewftools/ewfinfo.c index e4b5442..9938fcb 100644 --- a/ewftools/ewfinfo.c +++ b/ewftools/ewfinfo.c @@ -21,8 +21,11 @@ #include #include +#include #include +#include + #if defined( HAVE_SYS_RESOURCE_H ) #include #endif @@ -46,7 +49,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -135,7 +137,7 @@ void ewfinfo_signal_handler( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -144,19 +146,19 @@ int main( int argc, char * const argv[] ) #if defined( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif - libcstring_system_character_t * const *argv_filenames = NULL; + system_character_t * const *argv_filenames = NULL; #if !defined( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif libcerror_error_t *error = NULL; - libcstring_system_character_t *option_date_format = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *option_output_format = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfinfo" ); + system_character_t *option_date_format = NULL; + system_character_t *option_header_codepage = NULL; + system_character_t *option_output_format = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfinfo" ); - libcstring_system_integer_t option = 0; + system_integer_t option = 0; uint8_t verbose = 0; char info_option = 'a'; int number_of_filenames = 0; @@ -196,11 +198,11 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:d:ef:himvV" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:d:ef:himvV" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: ewftools_output_version_fprint( stderr, @@ -208,7 +210,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( @@ -216,17 +218,17 @@ int main( int argc, char * const argv[] ) goto on_error; - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'd': + case (system_integer_t) 'd': option_date_format = optarg; break; - case (libcstring_system_integer_t) 'e': + case (system_integer_t) 'e': if( info_option != 'a' ) { ewftools_output_version_fprint( @@ -235,7 +237,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Conflicting options: %" PRIc_LIBCSTRING_SYSTEM " and %c\n", + "Conflicting options: %" PRIc_SYSTEM " and %c\n", option, info_option ); @@ -248,12 +250,12 @@ int main( int argc, char * const argv[] ) break; - case (libcstring_system_integer_t) 'f': + case (system_integer_t) 'f': option_output_format = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': ewftools_output_version_fprint( stdout, program ); @@ -263,7 +265,7 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'i': + case (system_integer_t) 'i': if( info_option != 'a' ) { ewftools_output_version_fprint( @@ -272,7 +274,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Conflicting options: %" PRIc_LIBCSTRING_SYSTEM " and %c\n", + "Conflicting options: %" PRIc_SYSTEM " and %c\n", option, info_option ); @@ -285,7 +287,7 @@ int main( int argc, char * const argv[] ) break; - case (libcstring_system_integer_t) 'm': + case (system_integer_t) 'm': if( info_option != 'a' ) { ewftools_output_version_fprint( @@ -294,7 +296,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Conflicting options: %" PRIc_LIBCSTRING_SYSTEM " and %c\n", + "Conflicting options: %" PRIc_SYSTEM " and %c\n", option, info_option ); @@ -307,12 +309,12 @@ int main( int argc, char * const argv[] ) break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_version_fprint( stdout, program ); @@ -898,7 +900,7 @@ int main( int argc, char * const argv[] ) } fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); diff --git a/ewftools/ewfinput.c b/ewftools/ewfinput.c index fe9e699..dce90d2 100644 --- a/ewftools/ewfinput.c +++ b/ewftools/ewfinput.c @@ -22,7 +22,10 @@ #include #include #include +#include +#include #include +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -35,68 +38,67 @@ #include "byte_size_string.h" #include "ewfinput.h" #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_system_string.h" /* Input selection defintions */ -libcstring_system_character_t *ewfinput_compression_methods[ 1 ] = { - _LIBCSTRING_SYSTEM_STRING( "deflate" ) }; - -libcstring_system_character_t *ewfinput_compression_levels[ 4 ] = { - _LIBCSTRING_SYSTEM_STRING( "none" ), - _LIBCSTRING_SYSTEM_STRING( "empty-block" ), - _LIBCSTRING_SYSTEM_STRING( "fast" ), - _LIBCSTRING_SYSTEM_STRING( "best" ) }; - -libcstring_system_character_t *ewfinput_format_types[ 12 ] = { - _LIBCSTRING_SYSTEM_STRING( "ewf" ), - _LIBCSTRING_SYSTEM_STRING( "smart" ), - _LIBCSTRING_SYSTEM_STRING( "ftk" ), - _LIBCSTRING_SYSTEM_STRING( "encase1" ), - _LIBCSTRING_SYSTEM_STRING( "encase2" ), - _LIBCSTRING_SYSTEM_STRING( "encase3" ), - _LIBCSTRING_SYSTEM_STRING( "encase4" ), - _LIBCSTRING_SYSTEM_STRING( "encase5" ), - _LIBCSTRING_SYSTEM_STRING( "encase6" ), - _LIBCSTRING_SYSTEM_STRING( "linen5" ), - _LIBCSTRING_SYSTEM_STRING( "linen6" ), - _LIBCSTRING_SYSTEM_STRING( "ewfx" ) }; - -libcstring_system_character_t *ewfinput_media_types[ 4 ] = { - _LIBCSTRING_SYSTEM_STRING( "fixed" ), - _LIBCSTRING_SYSTEM_STRING( "removable" ), - _LIBCSTRING_SYSTEM_STRING( "optical" ), - _LIBCSTRING_SYSTEM_STRING( "memory" ) }; - -libcstring_system_character_t *ewfinput_media_flags[ 2 ] = { - _LIBCSTRING_SYSTEM_STRING( "logical" ), - _LIBCSTRING_SYSTEM_STRING( "physical" ) }; - -libcstring_system_character_t *ewfinput_sector_per_block_sizes[ 12 ] = { - _LIBCSTRING_SYSTEM_STRING( "16" ), - _LIBCSTRING_SYSTEM_STRING( "32" ), - _LIBCSTRING_SYSTEM_STRING( "64" ), - _LIBCSTRING_SYSTEM_STRING( "128" ), - _LIBCSTRING_SYSTEM_STRING( "256" ), - _LIBCSTRING_SYSTEM_STRING( "512" ), - _LIBCSTRING_SYSTEM_STRING( "1024" ), - _LIBCSTRING_SYSTEM_STRING( "2048" ), - _LIBCSTRING_SYSTEM_STRING( "4096" ), - _LIBCSTRING_SYSTEM_STRING( "8192" ), - _LIBCSTRING_SYSTEM_STRING( "16384" ), - _LIBCSTRING_SYSTEM_STRING( "32768" ) }; - -libcstring_system_character_t *ewfinput_yes_no[ 2 ] = { - _LIBCSTRING_SYSTEM_STRING( "yes" ), - _LIBCSTRING_SYSTEM_STRING( "no" ) }; +system_character_t *ewfinput_compression_methods[ 1 ] = { + _SYSTEM_STRING( "deflate" ) }; + +system_character_t *ewfinput_compression_levels[ 4 ] = { + _SYSTEM_STRING( "none" ), + _SYSTEM_STRING( "empty-block" ), + _SYSTEM_STRING( "fast" ), + _SYSTEM_STRING( "best" ) }; + +system_character_t *ewfinput_format_types[ 12 ] = { + _SYSTEM_STRING( "ewf" ), + _SYSTEM_STRING( "smart" ), + _SYSTEM_STRING( "ftk" ), + _SYSTEM_STRING( "encase1" ), + _SYSTEM_STRING( "encase2" ), + _SYSTEM_STRING( "encase3" ), + _SYSTEM_STRING( "encase4" ), + _SYSTEM_STRING( "encase5" ), + _SYSTEM_STRING( "encase6" ), + _SYSTEM_STRING( "linen5" ), + _SYSTEM_STRING( "linen6" ), + _SYSTEM_STRING( "ewfx" ) }; + +system_character_t *ewfinput_media_types[ 4 ] = { + _SYSTEM_STRING( "fixed" ), + _SYSTEM_STRING( "removable" ), + _SYSTEM_STRING( "optical" ), + _SYSTEM_STRING( "memory" ) }; + +system_character_t *ewfinput_media_flags[ 2 ] = { + _SYSTEM_STRING( "logical" ), + _SYSTEM_STRING( "physical" ) }; + +system_character_t *ewfinput_sector_per_block_sizes[ 12 ] = { + _SYSTEM_STRING( "16" ), + _SYSTEM_STRING( "32" ), + _SYSTEM_STRING( "64" ), + _SYSTEM_STRING( "128" ), + _SYSTEM_STRING( "256" ), + _SYSTEM_STRING( "512" ), + _SYSTEM_STRING( "1024" ), + _SYSTEM_STRING( "2048" ), + _SYSTEM_STRING( "4096" ), + _SYSTEM_STRING( "8192" ), + _SYSTEM_STRING( "16384" ), + _SYSTEM_STRING( "32768" ) }; + +system_character_t *ewfinput_yes_no[ 2 ] = { + _SYSTEM_STRING( "yes" ), + _SYSTEM_STRING( "no" ) }; /* Determines the EWF format from a string * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_ewf_format( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *ewf_format, libcerror_error_t **error ) { @@ -126,22 +128,22 @@ int ewfinput_determine_ewf_format( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 3 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "ewf" ), + _SYSTEM_STRING( "ewf" ), 3 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_EWF; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "ftk" ), + _SYSTEM_STRING( "ftk" ), 3 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_FTK; @@ -150,9 +152,9 @@ int ewfinput_determine_ewf_format( } else if( string_length == 4 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "ewfx" ), + _SYSTEM_STRING( "ewfx" ), 4 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_EWFX; @@ -161,9 +163,9 @@ int ewfinput_determine_ewf_format( } else if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "smart" ), + _SYSTEM_STRING( "smart" ), 5 ) == 0 ) { *ewf_format = LIBEWF_FORMAT_SMART; @@ -172,17 +174,17 @@ int ewfinput_determine_ewf_format( } else if( string_length == 6 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "linen" ), + _SYSTEM_STRING( "linen" ), 5 ) == 0 ) { - if( string[ 5 ] == (libcstring_system_character_t) '5' ) + if( string[ 5 ] == (system_character_t) '5' ) { *ewf_format = LIBEWF_FORMAT_LINEN5; result = 1; } - else if( string[ 5 ] == (libcstring_system_character_t) '6' ) + else if( string[ 5 ] == (system_character_t) '6' ) { *ewf_format = LIBEWF_FORMAT_LINEN6; result = 1; @@ -191,37 +193,37 @@ int ewfinput_determine_ewf_format( } else if( string_length == 7 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "encase" ), + _SYSTEM_STRING( "encase" ), 6 ) == 0 ) { - if( string[ 6 ] == (libcstring_system_character_t) '1' ) + if( string[ 6 ] == (system_character_t) '1' ) { *ewf_format = LIBEWF_FORMAT_ENCASE1; result = 1; } - else if( string[ 6 ] == (libcstring_system_character_t) '2' ) + else if( string[ 6 ] == (system_character_t) '2' ) { *ewf_format = LIBEWF_FORMAT_ENCASE2; result = 1; } - else if( string[ 6 ] == (libcstring_system_character_t) '3' ) + else if( string[ 6 ] == (system_character_t) '3' ) { *ewf_format = LIBEWF_FORMAT_ENCASE3; result = 1; } - else if( string[ 6 ] == (libcstring_system_character_t) '4' ) + else if( string[ 6 ] == (system_character_t) '4' ) { *ewf_format = LIBEWF_FORMAT_ENCASE4; result = 1; } - else if( string[ 6 ] == (libcstring_system_character_t) '5' ) + else if( string[ 6 ] == (system_character_t) '5' ) { *ewf_format = LIBEWF_FORMAT_ENCASE5; result = 1; } - else if( string[ 6 ] == (libcstring_system_character_t) '6' ) + else if( string[ 6 ] == (system_character_t) '6' ) { *ewf_format = LIBEWF_FORMAT_ENCASE6; result = 1; @@ -235,7 +237,7 @@ int ewfinput_determine_ewf_format( * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_sectors_per_chunk( - const libcstring_system_character_t *string, + const system_character_t *string, uint32_t *sectors_per_chunk, libcerror_error_t **error ) { @@ -265,30 +267,30 @@ int ewfinput_determine_sectors_per_chunk( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 2 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "16" ), + _SYSTEM_STRING( "16" ), 2 ) == 0 ) { *sectors_per_chunk = 16; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "32" ), + _SYSTEM_STRING( "32" ), 2 ) == 0 ) { *sectors_per_chunk = 32; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "64" ), + _SYSTEM_STRING( "64" ), 2 ) == 0 ) { *sectors_per_chunk = 64; @@ -297,25 +299,25 @@ int ewfinput_determine_sectors_per_chunk( } else if( string_length == 3 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "128" ), + _SYSTEM_STRING( "128" ), 3 ) == 0 ) { *sectors_per_chunk = 128; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "256" ), + _SYSTEM_STRING( "256" ), 3 ) == 0 ) { *sectors_per_chunk = 256; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "512" ), + _SYSTEM_STRING( "512" ), 3 ) == 0 ) { *sectors_per_chunk = 512; @@ -324,33 +326,33 @@ int ewfinput_determine_sectors_per_chunk( } else if( string_length == 4 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "1024" ), + _SYSTEM_STRING( "1024" ), 4 ) == 0 ) { *sectors_per_chunk = 1024; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "2048" ), + _SYSTEM_STRING( "2048" ), 4 ) == 0 ) { *sectors_per_chunk = 2048; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "4096" ), + _SYSTEM_STRING( "4096" ), 4 ) == 0 ) { *sectors_per_chunk = 4096; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "8192" ), + _SYSTEM_STRING( "8192" ), 4 ) == 0 ) { *sectors_per_chunk = 8192; @@ -359,17 +361,17 @@ int ewfinput_determine_sectors_per_chunk( } else if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "16384" ), + _SYSTEM_STRING( "16384" ), 5 ) == 0 ) { *sectors_per_chunk = 16384; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "32768" ), + _SYSTEM_STRING( "32768" ), 5 ) == 0 ) { *sectors_per_chunk = 32768; @@ -383,7 +385,7 @@ int ewfinput_determine_sectors_per_chunk( * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_compression_method( - const libcstring_system_character_t *string, + const system_character_t *string, uint16_t *compression_method, libcerror_error_t **error ) { @@ -413,14 +415,14 @@ int ewfinput_determine_compression_method( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 7 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "deflate" ), + _SYSTEM_STRING( "deflate" ), 7 ) == 0 ) { *compression_method = LIBEWF_COMPRESSION_METHOD_DEFLATE; @@ -434,7 +436,7 @@ int ewfinput_determine_compression_method( * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_compression_values( - const libcstring_system_character_t *string, + const system_character_t *string, int8_t *compression_level, uint8_t *compression_flags, libcerror_error_t **error ) @@ -476,32 +478,32 @@ int ewfinput_determine_compression_values( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 4 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "none" ), + _SYSTEM_STRING( "none" ), 4 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_NONE; *compression_flags = 0; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "fast" ), + _SYSTEM_STRING( "fast" ), 4 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_FAST; *compression_flags = 0; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "best" ), + _SYSTEM_STRING( "best" ), 4 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_BEST; @@ -511,18 +513,18 @@ int ewfinput_determine_compression_values( } else if( string_length == 11 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "empty-block" ), + _SYSTEM_STRING( "empty-block" ), 11 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_NONE; *compression_flags = LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "empty_block" ), + _SYSTEM_STRING( "empty_block" ), 11 ) == 0 ) { *compression_level = LIBEWF_COMPRESSION_NONE; @@ -537,7 +539,7 @@ int ewfinput_determine_compression_values( * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_media_type( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *media_type, libcerror_error_t **error ) { @@ -567,14 +569,14 @@ int ewfinput_determine_media_type( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "fixed" ), + _SYSTEM_STRING( "fixed" ), 5 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_FIXED; @@ -583,9 +585,9 @@ int ewfinput_determine_media_type( } else if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "memory" ), + _SYSTEM_STRING( "memory" ), 6 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_MEMORY; @@ -594,9 +596,9 @@ int ewfinput_determine_media_type( } else if( string_length == 7 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "optical" ), + _SYSTEM_STRING( "optical" ), 7 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_OPTICAL; @@ -605,9 +607,9 @@ int ewfinput_determine_media_type( } else if( string_length == 9 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "removable" ), + _SYSTEM_STRING( "removable" ), 9 ) == 0 ) { *media_type = LIBEWF_MEDIA_TYPE_REMOVABLE; @@ -621,7 +623,7 @@ int ewfinput_determine_media_type( * Returns 1 if successful or -1 on error */ int ewfinput_determine_media_flags( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *media_flags, libcerror_error_t **error ) { @@ -650,33 +652,33 @@ int ewfinput_determine_media_flags( return( -1 ); } - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "logical" ), + _SYSTEM_STRING( "logical" ), 7 ) == 0 ) { *media_flags &= ~LIBEWF_MEDIA_FLAG_PHYSICAL; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "physical" ), + _SYSTEM_STRING( "physical" ), 8 ) == 0 ) { *media_flags |= LIBEWF_MEDIA_FLAG_PHYSICAL; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "fastbloc" ), + _SYSTEM_STRING( "fastbloc" ), 8 ) == 0 ) { *media_flags |= LIBEWF_MEDIA_FLAG_FASTBLOC; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "tableau" ), + _SYSTEM_STRING( "tableau" ), 8 ) == 0 ) { *media_flags |= LIBEWF_MEDIA_FLAG_TABLEAU; @@ -689,7 +691,7 @@ int ewfinput_determine_media_flags( * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_header_codepage( - const libcstring_system_character_t *string, + const system_character_t *string, int *header_codepage, libcerror_error_t **error ) { @@ -719,14 +721,14 @@ int ewfinput_determine_header_codepage( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "ascii" ), + _SYSTEM_STRING( "ascii" ), 5 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ASCII; @@ -737,18 +739,18 @@ int ewfinput_determine_header_codepage( if( ( string_length == 10 ) || ( string_length == 11 ) ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "iso" ), + _SYSTEM_STRING( "iso" ), 3 ) == 0 ) { if( ( string[ 3 ] != '-' ) && ( string[ 3 ] != '_' ) ) { } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 4 ] ), - _LIBCSTRING_SYSTEM_STRING( "8859" ), + _SYSTEM_STRING( "8859" ), 4 ) == 0 ) { if( ( string[ 8 ] != '-' ) @@ -757,73 +759,73 @@ int ewfinput_determine_header_codepage( } else if( string_length == 10 ) { - if( libcstring_system_string_compare( + if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "1" ), + _SYSTEM_STRING( "1" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_1; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "2" ), + _SYSTEM_STRING( "2" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_2; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "3" ), + _SYSTEM_STRING( "3" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_3; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "4" ), + _SYSTEM_STRING( "4" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_4; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "5" ), + _SYSTEM_STRING( "5" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_5; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "6" ), + _SYSTEM_STRING( "6" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_6; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "7" ), + _SYSTEM_STRING( "7" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_7; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "8" ), + _SYSTEM_STRING( "8" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_8; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "9" ), + _SYSTEM_STRING( "9" ), 1 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_9; @@ -832,49 +834,49 @@ int ewfinput_determine_header_codepage( } else if( string_length == 11 ) { - if( libcstring_system_string_compare( + if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "10" ), + _SYSTEM_STRING( "10" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_10; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "11" ), + _SYSTEM_STRING( "11" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_11; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "13" ), + _SYSTEM_STRING( "13" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_13; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "14" ), + _SYSTEM_STRING( "14" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_14; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "15" ), + _SYSTEM_STRING( "15" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_15; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 9 ] ), - _LIBCSTRING_SYSTEM_STRING( "16" ), + _SYSTEM_STRING( "16" ), 2 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_ISO_8859_16; @@ -888,9 +890,9 @@ int ewfinput_determine_header_codepage( if( ( string_length == 11 ) || ( string_length == 12 ) ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "windows" ), + _SYSTEM_STRING( "windows" ), 7 ) == 0 ) { if( ( string[ 7 ] != '-' ) @@ -899,25 +901,25 @@ int ewfinput_determine_header_codepage( } else if( string_length == 11 ) { - if( libcstring_system_string_compare( + if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "874" ), + _SYSTEM_STRING( "874" ), 3 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_874; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "932" ), + _SYSTEM_STRING( "932" ), 3 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_932; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "936" ), + _SYSTEM_STRING( "936" ), 3 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_936; @@ -926,81 +928,81 @@ int ewfinput_determine_header_codepage( } else if( string_length == 12 ) { - if( libcstring_system_string_compare( + if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1250" ), + _SYSTEM_STRING( "1250" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1250; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1251" ), + _SYSTEM_STRING( "1251" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1251; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1252" ), + _SYSTEM_STRING( "1252" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1252; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1253" ), + _SYSTEM_STRING( "1253" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1253; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1253" ), + _SYSTEM_STRING( "1253" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1253; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1254" ), + _SYSTEM_STRING( "1254" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1254; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1255" ), + _SYSTEM_STRING( "1255" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1255; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1256" ), + _SYSTEM_STRING( "1256" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1256; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1257" ), + _SYSTEM_STRING( "1257" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1257; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( &( string[ 8 ] ), - _LIBCSTRING_SYSTEM_STRING( "1258" ), + _SYSTEM_STRING( "1258" ), 4 ) == 0 ) { *header_codepage = LIBEWF_CODEPAGE_WINDOWS_1258; @@ -1016,7 +1018,7 @@ int ewfinput_determine_header_codepage( * Returns 1 if successful, 0 if unsupported value or -1 on error */ int ewfinput_determine_yes_no( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *yes_no_value, libcerror_error_t **error ) { @@ -1046,14 +1048,14 @@ int ewfinput_determine_yes_no( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 2 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "no" ), + _SYSTEM_STRING( "no" ), 2 ) == 0 ) { *yes_no_value = 0; @@ -1062,9 +1064,9 @@ int ewfinput_determine_yes_no( } else if( string_length == 3 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "yes" ), + _SYSTEM_STRING( "yes" ), 3 ) == 0 ) { *yes_no_value = 1; @@ -1079,13 +1081,13 @@ int ewfinput_determine_yes_no( */ int ewfinput_get_string_variable( FILE *stream, - const libcstring_system_character_t *request_string, - libcstring_system_character_t *string_variable, + const system_character_t *request_string, + system_character_t *string_variable, size_t string_variable_size, libcerror_error_t **error ) { - libcstring_system_character_t *end_of_input = NULL; - libcstring_system_character_t *result_string = NULL; + system_character_t *end_of_input = NULL; + system_character_t *result_string = NULL; static char *function = "ewfinput_get_string_variable"; ssize_t input_length = 0; @@ -1145,10 +1147,10 @@ int ewfinput_get_string_variable( { fprintf( stream, - "%" PRIs_LIBCSTRING_SYSTEM ": ", + "%" PRIs_SYSTEM ": ", request_string ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, string_variable, @@ -1161,9 +1163,9 @@ int ewfinput_get_string_variable( #endif if( result_string != NULL ) { - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( string_variable, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', string_variable_size ); /* Input was larger than size of buffer @@ -1174,7 +1176,7 @@ int ewfinput_get_string_variable( */ while( end_of_input == NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, string_variable, @@ -1186,9 +1188,9 @@ int ewfinput_get_string_variable( (int) ( string_variable_size - 1 ) ); #endif - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( string_variable, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', string_variable_size ); } @@ -1225,17 +1227,17 @@ int ewfinput_get_string_variable( */ int ewfinput_get_size_variable( FILE *stream, - libcstring_system_character_t *input_buffer, + system_character_t *input_buffer, size_t input_buffer_size, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, uint64_t minimum_size, uint64_t maximum_size, uint64_t default_size, uint64_t *size_variable, libcerror_error_t **error ) { - libcstring_system_character_t *end_of_input = NULL; - libcstring_system_character_t *result_string = NULL; + system_character_t *end_of_input = NULL; + system_character_t *result_string = NULL; static char *function = "ewfinput_get_size_variable"; ssize_t input_length = 0; @@ -1306,13 +1308,13 @@ int ewfinput_get_size_variable( { fprintf( stream, - "%" PRIs_LIBCSTRING_SYSTEM " (%" PRIu64 " <= value <= %" PRIu64 ") [%" PRIu64 "]: ", + "%" PRIs_SYSTEM " (%" PRIu64 " <= value <= %" PRIu64 ") [%" PRIu64 "]: ", request_string, minimum_size, maximum_size, default_size ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, @@ -1325,9 +1327,9 @@ int ewfinput_get_size_variable( #endif if( result_string != NULL ) { - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( input_buffer, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', input_buffer_size ); /* Input was larger than size of buffer @@ -1338,7 +1340,7 @@ int ewfinput_get_size_variable( */ while( end_of_input == NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, @@ -1350,9 +1352,9 @@ int ewfinput_get_size_variable( (int) ( input_buffer_size - 1 ) ); #endif - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( input_buffer, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', input_buffer_size ); } @@ -1407,21 +1409,21 @@ int ewfinput_get_size_variable( */ int ewfinput_get_byte_size_variable( FILE *stream, - libcstring_system_character_t *input_buffer, + system_character_t *input_buffer, size_t input_buffer_size, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, uint64_t minimum_size, uint64_t maximum_size, uint64_t default_size, uint64_t *byte_size_variable, libcerror_error_t **error ) { - libcstring_system_character_t minimum_size_string[ 16 ]; - libcstring_system_character_t maximum_size_string[ 16 ]; - libcstring_system_character_t default_size_string[ 16 ]; + system_character_t minimum_size_string[ 16 ]; + system_character_t maximum_size_string[ 16 ]; + system_character_t default_size_string[ 16 ]; - libcstring_system_character_t *end_of_input = NULL; - libcstring_system_character_t *result_string = NULL; + system_character_t *end_of_input = NULL; + system_character_t *result_string = NULL; static char *function = "ewfinput_get_byte_size_variable"; ssize_t input_length = 0; @@ -1540,13 +1542,13 @@ int ewfinput_get_byte_size_variable( { fprintf( stream, - "%" PRIs_LIBCSTRING_SYSTEM " (%" PRIs_LIBCSTRING_SYSTEM " <= value <= %" PRIs_LIBCSTRING_SYSTEM ") [%" PRIs_LIBCSTRING_SYSTEM "]: ", + "%" PRIs_SYSTEM " (%" PRIs_SYSTEM " <= value <= %" PRIs_SYSTEM ") [%" PRIs_SYSTEM "]: ", request_string, minimum_size_string, maximum_size_string, default_size_string ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, @@ -1560,9 +1562,9 @@ int ewfinput_get_byte_size_variable( if( result_string != NULL ) { - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( input_buffer, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', input_buffer_size ); /* Input was larger than size of buffer @@ -1573,7 +1575,7 @@ int ewfinput_get_byte_size_variable( */ while( end_of_input == NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, @@ -1585,9 +1587,9 @@ int ewfinput_get_byte_size_variable( (int) ( input_buffer_size - 1 ) ); #endif - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( input_buffer, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', input_buffer_size ); } @@ -1642,18 +1644,18 @@ int ewfinput_get_byte_size_variable( */ int ewfinput_get_fixed_string_variable( FILE *stream, - libcstring_system_character_t *input_buffer, + system_character_t *input_buffer, size_t input_buffer_size, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **values, + const system_character_t *request_string, + system_character_t **values, uint8_t number_of_values, uint8_t default_value, - libcstring_system_character_t **fixed_string_variable, + system_character_t **fixed_string_variable, libcerror_error_t **error ) { - libcstring_system_character_t *end_of_input = NULL; - libcstring_system_character_t *result_string = NULL; + system_character_t *end_of_input = NULL; + system_character_t *result_string = NULL; static char *function = "ewfinput_get_fixed_value"; size_t value_length = 0; ssize_t input_length = 0; @@ -1733,7 +1735,7 @@ int ewfinput_get_fixed_string_variable( { fprintf( stream, - "%" PRIs_LIBCSTRING_SYSTEM " (", + "%" PRIs_SYSTEM " (", request_string ); for( value_iterator = 0; @@ -1748,15 +1750,15 @@ int ewfinput_get_fixed_string_variable( } fprintf( stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", values[ value_iterator ] ); } fprintf( stream, - ") [%" PRIs_LIBCSTRING_SYSTEM "]: ", + ") [%" PRIs_SYSTEM "]: ", values[ default_value ] ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, @@ -1770,9 +1772,9 @@ int ewfinput_get_fixed_string_variable( if( result_string != NULL ) { - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( input_buffer, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', input_buffer_size ); /* Input was larger than size of buffer @@ -1783,7 +1785,7 @@ int ewfinput_get_fixed_string_variable( */ while( end_of_input == NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result_string = file_stream_get_string_wide( stdin, input_buffer, @@ -1795,9 +1797,9 @@ int ewfinput_get_fixed_string_variable( (int) ( input_buffer_size - 1 ) ); #endif - end_of_input = libcstring_system_string_search_character( + end_of_input = system_string_search_character( input_buffer, - (libcstring_system_character_t) '\n', + (system_character_t) '\n', input_buffer_size ); } @@ -1819,11 +1821,11 @@ int ewfinput_get_fixed_string_variable( value_iterator < number_of_values; value_iterator++ ) { - value_length = libcstring_system_string_length( + value_length = system_string_length( values[ value_iterator ] ); if( ( value_length == (size_t) input_length ) - && ( libcstring_system_string_compare( + && ( system_string_compare( input_buffer, values[ value_iterator ], value_length ) == 0 ) ) diff --git a/ewftools/ewfinput.h b/ewftools/ewfinput.h index 5c7a23c..15b807a 100644 --- a/ewftools/ewfinput.h +++ b/ewftools/ewfinput.h @@ -26,7 +26,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #if defined( __cplusplus ) extern "C" { @@ -50,67 +49,67 @@ extern "C" { #define EWFINPUT_SECTOR_PER_BLOCK_SIZES_AMOUNT 12 #define EWFINPUT_SECTOR_PER_BLOCK_SIZES_DEFAULT 2 -extern libcstring_system_character_t *ewfinput_compression_methods[ 1 ]; -extern libcstring_system_character_t *ewfinput_compression_levels[ 4 ]; -extern libcstring_system_character_t *ewfinput_format_types[ 12 ]; -extern libcstring_system_character_t *ewfinput_media_types[ 4 ]; -extern libcstring_system_character_t *ewfinput_media_flags[ 2 ]; -extern libcstring_system_character_t *ewfinput_sector_per_block_sizes[ 12 ]; -extern libcstring_system_character_t *ewfinput_yes_no[ 2 ]; +extern system_character_t *ewfinput_compression_methods[ 1 ]; +extern system_character_t *ewfinput_compression_levels[ 4 ]; +extern system_character_t *ewfinput_format_types[ 12 ]; +extern system_character_t *ewfinput_media_types[ 4 ]; +extern system_character_t *ewfinput_media_flags[ 2 ]; +extern system_character_t *ewfinput_sector_per_block_sizes[ 12 ]; +extern system_character_t *ewfinput_yes_no[ 2 ]; int ewfinput_determine_ewf_format( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *ewf_format, libcerror_error_t **error ); int ewfinput_determine_sectors_per_chunk( - const libcstring_system_character_t *string, + const system_character_t *string, uint32_t *sectors_per_chunk, libcerror_error_t **error ); int ewfinput_determine_compression_method( - const libcstring_system_character_t *string, + const system_character_t *string, uint16_t *compression_method, libcerror_error_t **error ); int ewfinput_determine_compression_values( - const libcstring_system_character_t *string, + const system_character_t *string, int8_t *compression_level, uint8_t *compression_flags, libcerror_error_t **error ); int ewfinput_determine_media_type( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *media_type, libcerror_error_t **error ); int ewfinput_determine_media_flags( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *media_flags, libcerror_error_t **error ); int ewfinput_determine_header_codepage( - const libcstring_system_character_t *string, + const system_character_t *string, int *header_codepage, libcerror_error_t **error ); int ewfinput_determine_yes_no( - const libcstring_system_character_t *string, + const system_character_t *string, uint8_t *yes_no_value, libcerror_error_t **error ); int ewfinput_get_string_variable( FILE *stream, - const libcstring_system_character_t *request_string, - libcstring_system_character_t *string_variable, + const system_character_t *request_string, + system_character_t *string_variable, size_t string_variable_size, libcerror_error_t **error ); int ewfinput_get_size_variable( FILE *stream, - libcstring_system_character_t *input_buffer, + system_character_t *input_buffer, size_t input_buffer_size, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, uint64_t minimum_size, uint64_t maximum_size, uint64_t default_size, @@ -119,9 +118,9 @@ int ewfinput_get_size_variable( int ewfinput_get_byte_size_variable( FILE *stream, - libcstring_system_character_t *input_buffer, + system_character_t *input_buffer, size_t input_buffer_size, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, uint64_t minimum_size, uint64_t maximum_size, uint64_t default_size, @@ -130,13 +129,13 @@ int ewfinput_get_byte_size_variable( int ewfinput_get_fixed_string_variable( FILE *stream, - libcstring_system_character_t *input_buffer, + system_character_t *input_buffer, size_t input_buffer_size, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **values, + const system_character_t *request_string, + system_character_t **values, uint8_t number_of_values, uint8_t default_value, - libcstring_system_character_t **fixed_string_variable, + system_character_t **fixed_string_variable, libcerror_error_t **error ); #if defined( __cplusplus ) diff --git a/ewftools/ewfrecover.c b/ewftools/ewfrecover.c index 66267b4..f4389ce 100644 --- a/ewftools/ewfrecover.c +++ b/ewftools/ewfrecover.c @@ -21,20 +21,27 @@ #include #include +#include #include +#include + #if defined( HAVE_SYS_RESOURCE_H ) #include #endif -#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) -#include -#endif - #if defined( HAVE_IO_H ) || defined( WINAPI ) #include #endif +#if defined( HAVE_FCNTL_H ) || defined( WINAPI ) +#include +#endif + +#if defined( HAVE_STDLIB_H ) || defined( WINAPI ) +#include +#endif + #if defined( HAVE_GLOB_H ) #include #endif @@ -46,7 +53,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -144,7 +150,7 @@ void ewfrecover_signal_handler( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -153,9 +159,9 @@ int main( int argc, char * const argv[] ) #if defined( HAVE_GETRLIMIT ) struct rlimit limit_data; #endif - libcstring_system_character_t acquiry_operating_system[ 32 ]; + system_character_t acquiry_operating_system[ 32 ]; - libcstring_system_character_t * const *argv_filenames = NULL; + system_character_t * const *argv_filenames = NULL; libcerror_error_t *error = NULL; @@ -163,16 +169,16 @@ int main( int argc, char * const argv[] ) ewftools_glob_t *glob = NULL; #endif - libcstring_system_character_t *acquiry_software_version = NULL; - libcstring_system_character_t *log_filename = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *option_process_buffer_size = NULL; - libcstring_system_character_t *option_target_path = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfrecover" ); + system_character_t *acquiry_software_version = NULL; + system_character_t *log_filename = NULL; + system_character_t *option_header_codepage = NULL; + system_character_t *option_process_buffer_size = NULL; + system_character_t *option_target_path = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfrecover" ); log_handle_t *log_handle = NULL; - libcstring_system_integer_t option = 0; + system_integer_t option = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t use_chunk_data_functions = 0; @@ -240,11 +246,11 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:f:hl:p:qt:uvVx" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:f:hl:p:qt:uvVx" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: ewftools_output_version_fprint( stderr, @@ -252,7 +258,7 @@ int main( int argc, char * const argv[] ) fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); usage_fprint( @@ -260,12 +266,12 @@ int main( int argc, char * const argv[] ) goto on_error; - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': ewftools_output_version_fprint( stderr, program ); @@ -275,32 +281,32 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'l': + case (system_integer_t) 'l': log_filename = optarg; break; - case (libcstring_system_integer_t) 'p': + case (system_integer_t) 'p': option_process_buffer_size = optarg; break; - case (libcstring_system_integer_t) 'q': + case (system_integer_t) 'q': print_status_information = 0; break; - case (libcstring_system_integer_t) 't': + case (system_integer_t) 't': option_target_path = optarg; break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_version_fprint( stderr, program ); @@ -310,7 +316,7 @@ int main( int argc, char * const argv[] ) return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'x': + case (system_integer_t) 'x': use_chunk_data_functions = 1; break; @@ -537,7 +543,7 @@ int main( int argc, char * const argv[] ) */ if( export_handle_set_string( ewfrecover_export_handle, - _LIBCSTRING_SYSTEM_STRING( "recover" ), + _SYSTEM_STRING( "recover" ), &( ewfrecover_export_handle->target_path ), &( ewfrecover_export_handle->target_path_size ), &error ) != 1 ) @@ -595,7 +601,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to open log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -628,7 +634,7 @@ int main( int argc, char * const argv[] ) acquiry_operating_system[ 0 ] = 0; } - acquiry_software_version = _LIBCSTRING_SYSTEM_STRING( LIBEWF_VERSION_STRING ); + acquiry_software_version = _SYSTEM_STRING( LIBEWF_VERSION_STRING ); if( export_handle_set_output_values( ewfrecover_export_handle, @@ -671,7 +677,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to close log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to close log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -724,7 +730,7 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); @@ -733,14 +739,14 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": FAILURE\n", + "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": SUCCESS\n", + "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); diff --git a/ewftools/ewftools_libcstring.h b/ewftools/ewftools_libcstring.h deleted file mode 100644 index 998d59a..0000000 --- a/ewftools/ewftools_libcstring.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The internal libcstring header - * - * Copyright (c) 2006-2014, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _EWFTOOLS_LIBCSTRING_H ) -#define _EWFTOOLS_LIBCSTRING_H - -#include - -/* Define HAVE_LOCAL_LIBCSTRING for local use of libcstring - */ -#if defined( HAVE_LOCAL_LIBCSTRING ) - -#include -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCSTRING_DLL_IMPORT - * before including libcstring.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCSTRING_DLL_IMPORT -#endif - -#include - -#endif - -#endif - diff --git a/ewftools/ewfverify.c b/ewftools/ewfverify.c index 2f9ecb5..104361f 100644 --- a/ewftools/ewfverify.c +++ b/ewftools/ewfverify.c @@ -21,8 +21,11 @@ #include #include +#include #include +#include + #if defined( HAVE_SYS_RESOURCE_H ) #include #endif @@ -47,7 +50,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libclocale.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_output.h" #include "ewftools_signal.h" @@ -143,7 +145,7 @@ void ewfverify_signal_handler( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -154,22 +156,22 @@ int main( int argc, char * const argv[] ) #endif libcerror_error_t *error = NULL; - libcstring_system_character_t * const *argv_filenames = NULL; + system_character_t * const *argv_filenames = NULL; #if !defined( HAVE_GLOB_H ) ewftools_glob_t *glob = NULL; #endif - libcstring_system_character_t *log_filename = NULL; - libcstring_system_character_t *program = _LIBCSTRING_SYSTEM_STRING( "ewfverify" ); - libcstring_system_character_t *option_additional_digest_types = NULL; - libcstring_system_character_t *option_format = NULL; - libcstring_system_character_t *option_header_codepage = NULL; - libcstring_system_character_t *option_process_buffer_size = NULL; + system_character_t *log_filename = NULL; + system_character_t *program = _SYSTEM_STRING( "ewfverify" ); + system_character_t *option_additional_digest_types = NULL; + system_character_t *option_format = NULL; + system_character_t *option_header_codepage = NULL; + system_character_t *option_process_buffer_size = NULL; log_handle_t *log_handle = NULL; - libcstring_system_integer_t option = 0; + system_integer_t option = 0; uint8_t calculate_md5 = 1; uint8_t print_status_information = 1; uint8_t use_chunk_data_functions = 0; @@ -215,15 +217,15 @@ int main( int argc, char * const argv[] ) while( ( option = ewftools_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "A:d:f:hl:p:qvVwx" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "A:d:f:hl:p:qvVwx" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Invalid argument: %" PRIs_SYSTEM "\n", argv[ optind - 1 ] ); usage_fprint( @@ -231,59 +233,59 @@ int main( int argc, char * const argv[] ) goto on_error; - case (libcstring_system_integer_t) 'A': + case (system_integer_t) 'A': option_header_codepage = optarg; break; - case (libcstring_system_integer_t) 'd': + case (system_integer_t) 'd': option_additional_digest_types = optarg; break; - case (libcstring_system_integer_t) 'f': + case (system_integer_t) 'f': option_format = optarg; break; - case (libcstring_system_integer_t) 'h': + case (system_integer_t) 'h': usage_fprint( stdout ); return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'l': + case (system_integer_t) 'l': log_filename = optarg; break; - case (libcstring_system_integer_t) 'p': + case (system_integer_t) 'p': option_process_buffer_size = optarg; break; - case (libcstring_system_integer_t) 'q': + case (system_integer_t) 'q': print_status_information = 0; break; - case (libcstring_system_integer_t) 'v': + case (system_integer_t) 'v': verbose = 1; break; - case (libcstring_system_integer_t) 'V': + case (system_integer_t) 'V': ewftools_output_copyright_fprint( stdout ); return( EXIT_SUCCESS ); - case (libcstring_system_integer_t) 'w': + case (system_integer_t) 'w': zero_chunk_on_error = 1; break; - case (libcstring_system_integer_t) 'x': + case (system_integer_t) 'x': use_chunk_data_functions = 1; break; @@ -550,7 +552,7 @@ int main( int argc, char * const argv[] ) { fprintf( stderr, - "Unable to open log file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to open log file: %" PRIs_SYSTEM ".\n", log_filename ); goto on_error; @@ -657,7 +659,7 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": ABORTED\n", + "%" PRIs_SYSTEM ": ABORTED\n", program ); return( EXIT_FAILURE ); @@ -666,14 +668,14 @@ int main( int argc, char * const argv[] ) { fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": FAILURE\n", + "%" PRIs_SYSTEM ": FAILURE\n", program ); return( EXIT_FAILURE ); } fprintf( stdout, - "%" PRIs_LIBCSTRING_SYSTEM ": SUCCESS\n", + "%" PRIs_SYSTEM ": SUCCESS\n", program ); return( EXIT_SUCCESS ); diff --git a/ewftools/export_handle.c b/ewftools/export_handle.c index 12ca8e9..5634bdb 100644 --- a/ewftools/export_handle.c +++ b/ewftools/export_handle.c @@ -21,7 +21,18 @@ #include #include +#include +#include #include +#include + +#if defined( HAVE_IO_H ) || defined( WINAPI ) +#include +#endif + +#if defined( HAVE_UNISTD_H ) +#include +#endif #if defined( WINAPI ) #include @@ -38,7 +49,6 @@ #include "ewftools_libcfile.h" #include "ewftools_libcpath.h" #include "ewftools_libcsplit.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_libsmraw.h" #include "ewftools_libhmac.h" @@ -132,7 +142,7 @@ int export_handle_initialize( goto on_error; } - ( *export_handle )->input_buffer = libcstring_system_string_allocate( + ( *export_handle )->input_buffer = system_string_allocate( EXPORT_HANDLE_INPUT_BUFFER_SIZE ); if( ( *export_handle )->input_buffer == NULL ) @@ -149,7 +159,7 @@ int export_handle_initialize( if( memory_set( ( *export_handle )->input_buffer, 0, - sizeof( libcstring_system_character_t ) * EXPORT_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) + sizeof( system_character_t ) * EXPORT_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) { libcerror_error_set( error, @@ -162,7 +172,7 @@ int export_handle_initialize( } if( calculate_md5 != 0 ) { - ( *export_handle )->calculated_md5_hash_string = libcstring_system_string_allocate( + ( *export_handle )->calculated_md5_hash_string = system_string_allocate( 33 ); if( ( *export_handle )->calculated_md5_hash_string == NULL ) @@ -483,11 +493,11 @@ int export_handle_set_maximum_number_of_open_handles( */ int export_handle_open_input( export_handle_t *export_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { - libcstring_system_character_t **libewf_filenames = NULL; + system_character_t **libewf_filenames = NULL; static char *function = "export_handle_open_input"; size_t first_filename_length = 0; @@ -526,10 +536,10 @@ int export_handle_open_input( } if( number_of_filenames == 1 ) { - first_filename_length = libcstring_system_string_length( + first_filename_length = system_string_length( filenames[ 0 ] ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, @@ -556,9 +566,9 @@ int export_handle_open_input( return( -1 ); } - filenames = (libcstring_system_character_t * const *) libewf_filenames; + filenames = (system_character_t * const *) libewf_filenames; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( export_handle->input_handle, filenames, @@ -583,7 +593,7 @@ int export_handle_open_input( if( libewf_filenames != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -599,7 +609,7 @@ int export_handle_open_input( } if( libewf_filenames != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -671,10 +681,10 @@ int export_handle_open_input( */ int export_handle_open_output( export_handle_t *export_handle, - const libcstring_system_character_t *filename, + const system_character_t *filename, libcerror_error_t **error ) { - libcstring_system_character_t *filenames[ 1 ] = { NULL }; + system_character_t *filenames[ 1 ] = { NULL }; static char *function = "export_handle_open_output"; size_t filename_length = 0; @@ -738,9 +748,9 @@ int export_handle_open_output( return( -1 ); } - filenames[ 0 ] = (libcstring_system_character_t *) filename; + filenames[ 0 ] = (system_character_t *) filename; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( export_handle->ewf_output_handle, filenames, @@ -760,7 +770,7 @@ int export_handle_open_output( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open file: %" PRIs_LIBCSTRING_SYSTEM ".", + "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); @@ -773,13 +783,13 @@ int export_handle_open_output( } else if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) { - filename_length = libcstring_system_string_length( + filename_length = system_string_length( filename ); if( ( filename_length == 1 ) - && ( libcstring_system_string_compare( + && ( system_string_compare( filename, - _LIBCSTRING_SYSTEM_STRING( "-" ), + _SYSTEM_STRING( "-" ), 1 ) == 0 ) ) { export_handle->use_stdout = 1; @@ -810,9 +820,9 @@ int export_handle_open_output( return( -1 ); } - filenames[ 0 ] = (libcstring_system_character_t *) filename; + filenames[ 0 ] = (system_character_t *) filename; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libsmraw_handle_open_wide( export_handle->raw_output_handle, filenames, @@ -832,7 +842,7 @@ int export_handle_open_output( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open file: %" PRIs_LIBCSTRING_SYSTEM ".", + "%s: unable to open file: %" PRIs_SYSTEM ".", function, filename ); @@ -1948,8 +1958,8 @@ int export_handle_get_output_chunk_size( */ int export_handle_prompt_for_string( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **internal_string, + const system_character_t *request_string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { @@ -1999,7 +2009,7 @@ int export_handle_prompt_for_string( } *internal_string_size = EXPORT_HANDLE_STRING_SIZE; - *internal_string = libcstring_system_string_allocate( + *internal_string = system_string_allocate( *internal_string_size ); if( *internal_string == NULL ) @@ -2065,10 +2075,10 @@ int export_handle_prompt_for_string( */ int export_handle_prompt_for_compression_method( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "export_handle_prompt_for_compression_method"; uint8_t compression_methods_amount = 0; int result = 0; @@ -2145,10 +2155,10 @@ int export_handle_prompt_for_compression_method( */ int export_handle_prompt_for_compression_level( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "export_handle_prompt_for_compression_level"; int result = 0; @@ -2213,32 +2223,32 @@ int export_handle_prompt_for_compression_level( */ int export_handle_prompt_for_output_format( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "export_handle_prompt_for_output_format"; size_t fixed_string_variable_length = 0; int result = 0; - libcstring_system_character_t *format_types[ 17 ] = \ - { _LIBCSTRING_SYSTEM_STRING( "raw" ), - _LIBCSTRING_SYSTEM_STRING( "files" ), - _LIBCSTRING_SYSTEM_STRING( "ewf" ), - _LIBCSTRING_SYSTEM_STRING( "smart" ), - _LIBCSTRING_SYSTEM_STRING( "ftk" ), - _LIBCSTRING_SYSTEM_STRING( "encase1" ), - _LIBCSTRING_SYSTEM_STRING( "encase2" ), - _LIBCSTRING_SYSTEM_STRING( "encase3" ), - _LIBCSTRING_SYSTEM_STRING( "encase4" ), - _LIBCSTRING_SYSTEM_STRING( "encase5" ), - _LIBCSTRING_SYSTEM_STRING( "encase6" ), - _LIBCSTRING_SYSTEM_STRING( "encase7" ), - _LIBCSTRING_SYSTEM_STRING( "encase7-v2" ), - _LIBCSTRING_SYSTEM_STRING( "linen5" ), - _LIBCSTRING_SYSTEM_STRING( "linen6" ), - _LIBCSTRING_SYSTEM_STRING( "linen7" ), - _LIBCSTRING_SYSTEM_STRING( "ewfx" ) }; + system_character_t *format_types[ 17 ] = \ + { _SYSTEM_STRING( "raw" ), + _SYSTEM_STRING( "files" ), + _SYSTEM_STRING( "ewf" ), + _SYSTEM_STRING( "smart" ), + _SYSTEM_STRING( "ftk" ), + _SYSTEM_STRING( "encase1" ), + _SYSTEM_STRING( "encase2" ), + _SYSTEM_STRING( "encase3" ), + _SYSTEM_STRING( "encase4" ), + _SYSTEM_STRING( "encase5" ), + _SYSTEM_STRING( "encase6" ), + _SYSTEM_STRING( "encase7" ), + _SYSTEM_STRING( "encase7-v2" ), + _SYSTEM_STRING( "linen5" ), + _SYSTEM_STRING( "linen6" ), + _SYSTEM_STRING( "linen7" ), + _SYSTEM_STRING( "ewfx" ) }; if( export_handle == NULL ) { @@ -2277,14 +2287,14 @@ int export_handle_prompt_for_output_format( { result = 0; - fixed_string_variable_length = libcstring_system_string_length( + fixed_string_variable_length = system_string_length( fixed_string_variable ); if( fixed_string_variable_length == 3 ) { - if( libcstring_system_string_compare( + if( system_string_compare( fixed_string_variable, - _LIBCSTRING_SYSTEM_STRING( "raw" ), + _SYSTEM_STRING( "raw" ), 3 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_RAW; @@ -2293,9 +2303,9 @@ int export_handle_prompt_for_output_format( } else if( fixed_string_variable_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( fixed_string_variable, - _LIBCSTRING_SYSTEM_STRING( "files" ), + _SYSTEM_STRING( "files" ), 5 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_FILES; @@ -2331,10 +2341,10 @@ int export_handle_prompt_for_output_format( */ int export_handle_prompt_for_sectors_per_chunk( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "export_handle_prompt_for_sectors_per_chunk"; int result = 0; @@ -2398,7 +2408,7 @@ int export_handle_prompt_for_sectors_per_chunk( */ int export_handle_prompt_for_maximum_segment_size( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "export_handle_prompt_for_maximum_segment_size"; @@ -2466,7 +2476,7 @@ int export_handle_prompt_for_maximum_segment_size( */ int export_handle_prompt_for_export_offset( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "export_handle_prompt_for_export_offset"; @@ -2516,7 +2526,7 @@ int export_handle_prompt_for_export_offset( */ int export_handle_prompt_for_export_size( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "export_handle_prompt_for_export_size"; @@ -2580,8 +2590,8 @@ int export_handle_prompt_for_export_size( */ int export_handle_set_string( export_handle_t *export_handle, - const libcstring_system_character_t *string, - libcstring_system_character_t **internal_string, + const system_character_t *string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { @@ -2640,12 +2650,12 @@ int export_handle_set_string( *internal_string = NULL; *internal_string_size = 0; } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length > 0 ) { - *internal_string = libcstring_system_string_allocate( + *internal_string = system_string_allocate( string_length + 1 ); if( *internal_string == NULL ) @@ -2659,7 +2669,7 @@ int export_handle_set_string( goto on_error; } - if( libcstring_system_string_copy( + if( system_string_copy( *internal_string, string, string_length ) == NULL ) @@ -2697,10 +2707,10 @@ int export_handle_set_string( */ int export_handle_set_compression_values( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { - libcstring_system_character_t *string_segment = NULL; + system_character_t *string_segment = NULL; static char *function = "export_handle_set_compression_values"; size_t string_segment_size = 0; size_t string_length = 0; @@ -2708,7 +2718,7 @@ int export_handle_set_compression_values( int result = 0; int segment_index = 0; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; @@ -2725,10 +2735,10 @@ int export_handle_set_compression_values( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, @@ -2753,7 +2763,7 @@ int export_handle_set_compression_values( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, @@ -2788,7 +2798,7 @@ int export_handle_set_compression_values( } if( number_of_segments == 2 ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, @@ -2855,7 +2865,7 @@ int export_handle_set_compression_values( } segment_index++; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, @@ -2910,7 +2920,7 @@ int export_handle_set_compression_values( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) @@ -2934,7 +2944,7 @@ int export_handle_set_compression_values( on_error: if( string_elements != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); @@ -2953,7 +2963,7 @@ int export_handle_set_compression_values( */ int export_handle_set_output_format( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_output_format"; @@ -2971,14 +2981,14 @@ int export_handle_set_output_format( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 3 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "raw" ), + _SYSTEM_STRING( "raw" ), 3 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_RAW; @@ -2987,9 +2997,9 @@ int export_handle_set_output_format( } else if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "files" ), + _SYSTEM_STRING( "files" ), 5 ) == 0 ) { export_handle->output_format = EXPORT_HANDLE_OUTPUT_FORMAT_FILES; @@ -3023,7 +3033,7 @@ int export_handle_set_output_format( */ int export_handle_set_sectors_per_chunk( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_sectors_per_chunk"; @@ -3064,7 +3074,7 @@ int export_handle_set_sectors_per_chunk( */ int export_handle_set_maximum_segment_size( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_maximum_segment_size"; @@ -3082,7 +3092,7 @@ int export_handle_set_maximum_segment_size( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); result = byte_size_string_convert( @@ -3136,7 +3146,7 @@ int export_handle_set_maximum_segment_size( */ int export_handle_set_export_offset( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_export_offset"; @@ -3165,9 +3175,9 @@ int export_handle_set_export_offset( return( -1 ); } - if( string[ 0 ] != (libcstring_system_character_t) '-' ) + if( string[ 0 ] != (system_character_t) '-' ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( @@ -3195,7 +3205,7 @@ int export_handle_set_export_offset( */ int export_handle_set_export_size( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_export_size"; @@ -3224,9 +3234,9 @@ int export_handle_set_export_size( return( -1 ); } - if( string[ 0 ] != (libcstring_system_character_t) '-' ) + if( string[ 0 ] != (system_character_t) '-' ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( @@ -3254,7 +3264,7 @@ int export_handle_set_export_size( */ int export_handle_set_header_codepage( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_header_codepage"; @@ -3295,7 +3305,7 @@ int export_handle_set_header_codepage( */ int export_handle_set_process_buffer_size( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "export_handle_set_process_buffer_size"; @@ -3314,7 +3324,7 @@ int export_handle_set_process_buffer_size( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); result = byte_size_string_convert( @@ -3355,10 +3365,10 @@ int export_handle_set_process_buffer_size( */ int export_handle_set_additional_digest_types( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { - libcstring_system_character_t *string_segment = NULL; + system_character_t *string_segment = NULL; static char *function = "export_handle_set_additional_digest_types"; size_t string_length = 0; size_t string_segment_size = 0; @@ -3368,7 +3378,7 @@ int export_handle_set_additional_digest_types( int result = 0; int segment_index = 0; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; @@ -3385,10 +3395,10 @@ int export_handle_set_additional_digest_types( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, @@ -3413,7 +3423,7 @@ int export_handle_set_additional_digest_types( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, @@ -3438,7 +3448,7 @@ int export_handle_set_additional_digest_types( segment_index < number_of_segments; segment_index++ ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, @@ -3478,16 +3488,16 @@ int export_handle_set_additional_digest_types( } if( string_segment_size == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha1" ), + _SYSTEM_STRING( "sha1" ), 4 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA1" ), + _SYSTEM_STRING( "SHA1" ), 4 ) == 0 ) { calculate_sha1 = 1; @@ -3495,30 +3505,30 @@ int export_handle_set_additional_digest_types( } else if( string_segment_size == 6 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha-1" ), + _SYSTEM_STRING( "sha-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha_1" ), + _SYSTEM_STRING( "sha_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA-1" ), + _SYSTEM_STRING( "SHA-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA_1" ), + _SYSTEM_STRING( "SHA_1" ), 5 ) == 0 ) { calculate_sha1 = 1; @@ -3526,16 +3536,16 @@ int export_handle_set_additional_digest_types( } else if( string_segment_size == 7 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha256" ), + _SYSTEM_STRING( "sha256" ), 6 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA256" ), + _SYSTEM_STRING( "SHA256" ), 6 ) == 0 ) { calculate_sha256 = 1; @@ -3543,30 +3553,30 @@ int export_handle_set_additional_digest_types( } else if( string_segment_size == 8 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha-256" ), + _SYSTEM_STRING( "sha-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha_256" ), + _SYSTEM_STRING( "sha_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA-256" ), + _SYSTEM_STRING( "SHA-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA_256" ), + _SYSTEM_STRING( "SHA_256" ), 7 ) == 0 ) { calculate_sha256 = 1; @@ -3576,7 +3586,7 @@ int export_handle_set_additional_digest_types( if( ( calculate_sha1 != 0 ) && ( export_handle->calculate_sha1 == 0 ) ) { - export_handle->calculated_sha1_hash_string = libcstring_system_string_allocate( + export_handle->calculated_sha1_hash_string = system_string_allocate( 41 ); if( export_handle->calculated_sha1_hash_string == NULL ) @@ -3595,7 +3605,7 @@ int export_handle_set_additional_digest_types( if( ( calculate_sha256 != 0 ) && ( export_handle->calculate_sha256 == 0 ) ) { - export_handle->calculated_sha256_hash_string = libcstring_system_string_allocate( + export_handle->calculated_sha256_hash_string = system_string_allocate( 65 ); if( export_handle->calculated_sha256_hash_string == NULL ) @@ -3611,7 +3621,7 @@ int export_handle_set_additional_digest_types( } export_handle->calculate_sha256 = 1; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) @@ -3635,7 +3645,7 @@ int export_handle_set_additional_digest_types( on_error: if( string_elements != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); @@ -3653,9 +3663,9 @@ int export_handle_set_additional_digest_types( */ int export_handle_set_output_values( export_handle_t *export_handle, - libcstring_system_character_t *acquiry_operating_system, - libcstring_system_character_t *acquiry_software, - libcstring_system_character_t *acquiry_software_version, + system_character_t *acquiry_operating_system, + system_character_t *acquiry_software, + system_character_t *acquiry_software_version, uint8_t zero_chunk_on_error, uint8_t copy_input_values, libcerror_error_t **error ) @@ -3740,10 +3750,10 @@ int export_handle_set_output_values( */ if( acquiry_operating_system != NULL ) { - value_string_length = libcstring_system_string_length( + value_string_length = system_string_length( acquiry_operating_system ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_operating_system", @@ -3772,10 +3782,10 @@ int export_handle_set_output_values( return( -1 ); } } - value_string_length = libcstring_system_string_length( + value_string_length = system_string_length( acquiry_software ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_software", @@ -3803,10 +3813,10 @@ int export_handle_set_output_values( return( -1 ); } - value_string_length = libcstring_system_string_length( + value_string_length = system_string_length( acquiry_software_version ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( export_handle->ewf_output_handle, (uint8_t *) "acquiry_software_version", @@ -4132,7 +4142,7 @@ int export_handle_set_hash_value( export_handle_t *export_handle, char *hash_value_identifier, size_t hash_value_identifier_length, - libcstring_system_character_t *hash_value, + system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ) { @@ -4152,7 +4162,7 @@ int export_handle_set_hash_value( } if( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_EWF ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_hash_value( export_handle->ewf_output_handle, (uint8_t *) hash_value_identifier, @@ -4185,7 +4195,7 @@ int export_handle_set_hash_value( else if( ( export_handle->output_format == EXPORT_HANDLE_OUTPUT_FORMAT_RAW ) && ( export_handle->use_stdout == 0 ) ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libsmraw_handle_set_utf16_integrity_hash_value( export_handle->raw_output_handle, (uint8_t *) hash_value_identifier, @@ -4632,9 +4642,9 @@ int export_handle_export_input( } if( process_status_initialize( &process_status, - _LIBCSTRING_SYSTEM_STRING( "Export" ), - _LIBCSTRING_SYSTEM_STRING( "exported" ), - _LIBCSTRING_SYSTEM_STRING( "Written" ), + _SYSTEM_STRING( "Export" ), + _SYSTEM_STRING( "exported" ), + _SYSTEM_STRING( "Written" ), stderr, print_status_information, error ) != 1 ) @@ -5095,7 +5105,7 @@ int export_handle_export_input( */ int export_handle_export_single_files( export_handle_t *export_handle, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ) @@ -5131,7 +5141,7 @@ int export_handle_export_single_files( return( -1 ); } - export_path_length = libcstring_system_string_length( + export_path_length = system_string_length( export_handle->target_path ); #if defined( HAVE_WIDE_SYSTEM_CHARACTER ) @@ -5177,9 +5187,9 @@ int export_handle_export_single_files( } if( process_status_initialize( &process_status, - _LIBCSTRING_SYSTEM_STRING( "Export" ), - _LIBCSTRING_SYSTEM_STRING( "exported" ), - _LIBCSTRING_SYSTEM_STRING( "Written" ), + _SYSTEM_STRING( "Export" ), + _SYSTEM_STRING( "exported" ), + _SYSTEM_STRING( "Written" ), stderr, print_status_information, error ) != 1 ) @@ -5206,7 +5216,7 @@ int export_handle_export_single_files( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_make_directory_wide( sanitized_name, error ) != 1 ) @@ -5220,7 +5230,7 @@ int export_handle_export_single_files( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, - "%s: unable to create directory: %" PRIs_LIBCSTRING_SYSTEM "", + "%s: unable to create directory: %" PRIs_SYSTEM "", function, sanitized_name ); @@ -5228,7 +5238,7 @@ int export_handle_export_single_files( } log_handle_printf( log_handle, - "Created directory: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Created directory: %" PRIs_SYSTEM ".\n", sanitized_name ); result = export_handle_export_file_entry( @@ -5335,14 +5345,14 @@ int export_handle_export_single_files( int export_handle_export_file_entry( export_handle_t *export_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, size_t export_path_size, size_t file_entry_path_index, log_handle_t *log_handle, libcerror_error_t **error ) { - libcstring_system_character_t *name = NULL; - libcstring_system_character_t *target_path = NULL; + system_character_t *name = NULL; + system_character_t *target_path = NULL; system_character_t *sanitized_name = NULL; static char *function = "export_handle_export_file_entry"; size_t name_size = 0; @@ -5388,7 +5398,7 @@ int export_handle_export_file_entry( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name_size( file_entry, &name_size, @@ -5412,7 +5422,7 @@ int export_handle_export_file_entry( } if( name_size > 1 ) { - name = libcstring_system_string_allocate( + name = system_string_allocate( name_size ); if( name == NULL ) @@ -5426,7 +5436,7 @@ int export_handle_export_file_entry( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name( file_entry, (uint16_t *) name, @@ -5480,7 +5490,7 @@ int export_handle_export_file_entry( name = NULL; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_join_wide( &target_path, &target_path_size, @@ -5525,7 +5535,7 @@ int export_handle_export_file_entry( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libcfile_file_exists_wide( target_path, error ); @@ -5540,7 +5550,7 @@ int export_handle_export_file_entry( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_GENERIC, - "%s: unable to determine if %" PRIs_LIBCSTRING_SYSTEM " exists.", + "%s: unable to determine if %" PRIs_SYSTEM " exists.", function, target_path ); @@ -5569,7 +5579,7 @@ int export_handle_export_file_entry( */ fprintf( export_handle->notify_stream, - "Single file: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Single file: %" PRIs_SYSTEM "\n", &( target_path[ file_entry_path_index ] ) ); return_value = export_handle_export_file_entry_data( @@ -5608,7 +5618,7 @@ int export_handle_export_file_entry( } else if( file_entry_type == LIBEWF_FILE_ENTRY_TYPE_DIRECTORY ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_make_directory_wide( target_path, error ) != 1 ) @@ -5622,7 +5632,7 @@ int export_handle_export_file_entry( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_WRITE_FAILED, - "%s: unable to create directory: %" PRIs_LIBCSTRING_SYSTEM "", + "%s: unable to create directory: %" PRIs_SYSTEM "", function, target_path ); @@ -5630,7 +5640,7 @@ int export_handle_export_file_entry( } log_handle_printf( log_handle, - "Created directory: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Created directory: %" PRIs_SYSTEM ".\n", target_path ); } } @@ -5640,7 +5650,7 @@ int export_handle_export_file_entry( log_handle, "Skipping file entry without a name.\n" ); - target_path = (libcstring_system_character_t *) export_path; + target_path = (system_character_t *) export_path; target_path_size = export_path_size; } if( file_entry_type == LIBEWF_FILE_ENTRY_TYPE_DIRECTORY ) @@ -5703,7 +5713,7 @@ int export_handle_export_file_entry( int export_handle_export_file_entry_data( export_handle_t *export_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, libcerror_error_t **error ) { libcfile_file_t *file = NULL; @@ -5784,7 +5794,7 @@ int export_handle_export_file_entry_data( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcfile_file_open_wide( file, export_path, @@ -5802,7 +5812,7 @@ int export_handle_export_file_entry_data( error, LIBCERROR_ERROR_DOMAIN_IO, LIBCERROR_IO_ERROR_OPEN_FAILED, - "%s: unable to open file: %" PRIs_LIBCSTRING_SYSTEM ".", + "%s: unable to open file: %" PRIs_SYSTEM ".", function, export_path ); @@ -5975,7 +5985,7 @@ int export_handle_export_file_entry_data( int export_handle_export_file_entry_sub_file_entries( export_handle_t *export_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, size_t export_path_size, size_t file_entry_path_index, log_handle_t *log_handle, @@ -6132,7 +6142,7 @@ int export_handle_hash_values_fprint( } fprintf( stream, - "MD5 hash calculated over data:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "MD5 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", export_handle->calculated_md5_hash_string ); } if( export_handle->calculate_sha1 != 0 ) @@ -6150,7 +6160,7 @@ int export_handle_hash_values_fprint( } fprintf( stream, - "SHA1 hash calculated over data:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA1 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", export_handle->calculated_sha1_hash_string ); } if( export_handle->calculate_sha256 != 0 ) @@ -6168,7 +6178,7 @@ int export_handle_hash_values_fprint( } fprintf( stream, - "SHA256 hash calculated over data:\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA256 hash calculated over data:\t%" PRIs_SYSTEM "\n", export_handle->calculated_sha256_hash_string ); } return( 1 ); @@ -6182,8 +6192,8 @@ int export_handle_checksum_errors_fprint( FILE *stream, libcerror_error_t **error ) { - libcstring_system_character_t *filename = NULL; - libcstring_system_character_t *last_filename = NULL; + system_character_t *filename = NULL; + system_character_t *last_filename = NULL; static char *function = "export_handle_checksum_errors_fprint"; size_t filename_size = 0; size_t last_filename_size = 0; @@ -6299,7 +6309,7 @@ int export_handle_checksum_errors_fprint( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_filename_size_wide( export_handle->input_handle, &filename_size, @@ -6324,7 +6334,7 @@ int export_handle_checksum_errors_fprint( } else if( result != 0 ) { - filename = libcstring_system_string_allocate( + filename = system_string_allocate( filename_size ); @@ -6339,7 +6349,7 @@ int export_handle_checksum_errors_fprint( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_get_filename_wide( export_handle->input_handle, filename, @@ -6366,7 +6376,7 @@ int export_handle_checksum_errors_fprint( { fprintf( stream, - " %" PRIs_LIBCSTRING_SYSTEM "", + " %" PRIs_SYSTEM "", filename ); last_filename = filename; @@ -6380,7 +6390,7 @@ int export_handle_checksum_errors_fprint( { fprintf( stream, - ", %" PRIs_LIBCSTRING_SYSTEM "", + ", %" PRIs_SYSTEM "", filename ); memory_free( diff --git a/ewftools/export_handle.h b/ewftools/export_handle.h index 2e209cc..a9418ac 100644 --- a/ewftools/export_handle.h +++ b/ewftools/export_handle.h @@ -27,7 +27,6 @@ #include "digest_hash.h" #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "ewftools_libsmraw.h" @@ -51,11 +50,11 @@ struct export_handle { /* The user input buffer */ - libcstring_system_character_t *input_buffer; + system_character_t *input_buffer; /* The target path */ - libcstring_system_character_t *target_path; + system_character_t *target_path; /* The target path size */ @@ -115,7 +114,7 @@ struct export_handle /* The calculated MD5 digest hash string */ - libcstring_system_character_t *calculated_md5_hash_string; + system_character_t *calculated_md5_hash_string; /* Value to indicate if the SHA1 digest hash should be calculated */ @@ -131,7 +130,7 @@ struct export_handle /* The calculated SHA1 digest hash string */ - libcstring_system_character_t *calculated_sha1_hash_string; + system_character_t *calculated_sha1_hash_string; /* Value to indicate if the SHA256 digest hash should be calculated */ @@ -147,7 +146,7 @@ struct export_handle /* The calculated SHA256 digest hash string */ - libcstring_system_character_t *calculated_sha256_hash_string; + system_character_t *calculated_sha256_hash_string; /* Value to indicate if the chunk data instead of the buffered read and write functions should be used */ @@ -227,13 +226,13 @@ int export_handle_set_maximum_number_of_open_handles( int export_handle_open_input( export_handle_t *export_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); int export_handle_open_output( export_handle_t *export_handle, - const libcstring_system_character_t *filename, + const system_character_t *filename, libcerror_error_t **error ); int export_handle_close( @@ -298,103 +297,103 @@ int export_handle_get_output_chunk_size( int export_handle_prompt_for_string( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **internal_string, + const system_character_t *request_string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ); int export_handle_prompt_for_compression_method( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_compression_level( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_output_format( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_sectors_per_chunk( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_maximum_segment_size( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_export_offset( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int export_handle_prompt_for_export_size( export_handle_t *export_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int export_handle_set_string( export_handle_t *export_handle, - const libcstring_system_character_t *string, - libcstring_system_character_t **internal_string, + const system_character_t *string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ); int export_handle_set_compression_values( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_output_format( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_sectors_per_chunk( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_maximum_segment_size( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_export_offset( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_export_size( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_header_codepage( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_process_buffer_size( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_additional_digest_types( export_handle_t *export_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int export_handle_set_output_values( export_handle_t *export_handle, - libcstring_system_character_t *acquiry_operating_system, - libcstring_system_character_t *acquiry_software, - libcstring_system_character_t *acquiry_software_version, + system_character_t *acquiry_operating_system, + system_character_t *acquiry_software, + system_character_t *acquiry_software_version, uint8_t zero_chunk_on_error, uint8_t copy_input_values, libcerror_error_t **error ); @@ -403,7 +402,7 @@ int export_handle_set_hash_value( export_handle_t *export_handle, char *hash_value_identifier, size_t hash_value_identifier_length, - libcstring_system_character_t *hash_value, + system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ); @@ -426,7 +425,7 @@ int export_handle_export_input( int export_handle_export_single_files( export_handle_t *export_handle, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, uint8_t print_status_information, log_handle_t *log_handle, libcerror_error_t **error ); @@ -434,7 +433,7 @@ int export_handle_export_single_files( int export_handle_export_file_entry( export_handle_t *export_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, size_t export_path_size, size_t file_entry_path_index, log_handle_t *log_handle, @@ -443,13 +442,13 @@ int export_handle_export_file_entry( int export_handle_export_file_entry_data( export_handle_t *export_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, libcerror_error_t **error ); int export_handle_export_file_entry_sub_file_entries( export_handle_t *export_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *export_path, + const system_character_t *export_path, size_t export_path_size, size_t file_entry_path_index, log_handle_t *log_handle, diff --git a/ewftools/guid.c b/ewftools/guid.c index ca79ce0..33071f1 100644 --- a/ewftools/guid.c +++ b/ewftools/guid.c @@ -21,7 +21,10 @@ #include #include +#include +#include #include +#include #if defined( WINAPI ) #include @@ -31,7 +34,6 @@ #endif #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "guid.h" #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) @@ -161,7 +163,7 @@ int guid_to_string( uint8_t *guid, size_t guid_size, int byte_order, - libcstring_system_character_t *string, + system_character_t *string, size_t string_size, libcerror_error_t **error ) { @@ -251,25 +253,25 @@ int guid_to_string( */ if( byte_order == _BYTE_STREAM_ENDIAN_BIG ) { - print_count = libcstring_system_string_sprintf( + print_count = system_string_sprintf( string, string_size, - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ), + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ), guid[ 0 ], guid[ 1 ], guid[ 2 ], guid[ 3 ], guid[ 4 ], guid[ 5 ], guid[ 6 ], guid[ 7 ], @@ -278,25 +280,25 @@ int guid_to_string( } else if( byte_order == _BYTE_STREAM_ENDIAN_LITTLE ) { - print_count = libcstring_system_string_sprintf( + print_count = system_string_sprintf( string, string_size, - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "-%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ) - _LIBCSTRING_SYSTEM_STRING( "%.2" ) _LIBCSTRING_SYSTEM_STRING( PRIx8 ), + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "-%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ) + _SYSTEM_STRING( "%.2" ) _SYSTEM_STRING( PRIx8 ), guid[ 3 ], guid[ 2 ], guid[ 1 ], guid[ 0 ], guid[ 5 ], guid[ 4 ], guid[ 7 ], guid[ 6 ], diff --git a/ewftools/guid.h b/ewftools/guid.h index 861ad90..b97a75d 100644 --- a/ewftools/guid.h +++ b/ewftools/guid.h @@ -26,7 +26,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #if defined( __cplusplus ) extern "C" { @@ -52,7 +51,7 @@ int guid_to_string( uint8_t *guid, size_t guid_size, int byte_order, - libcstring_system_character_t *string, + system_character_t *string, size_t string_size, libcerror_error_t **error ); diff --git a/ewftools/imaging_handle.c b/ewftools/imaging_handle.c index 6dc3bf0..9f5a703 100644 --- a/ewftools/imaging_handle.c +++ b/ewftools/imaging_handle.c @@ -21,7 +21,10 @@ #include #include +#include +#include #include +#include #if defined( WINAPI ) #include @@ -37,7 +40,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libcnotify.h" #include "ewftools_libcsplit.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "ewftools_system_string.h" @@ -117,7 +119,7 @@ int imaging_handle_initialize( return( -1 ); } - ( *imaging_handle )->input_buffer = libcstring_system_string_allocate( + ( *imaging_handle )->input_buffer = system_string_allocate( IMAGING_HANDLE_INPUT_BUFFER_SIZE ); if( ( *imaging_handle )->input_buffer == NULL ) @@ -134,7 +136,7 @@ int imaging_handle_initialize( if( memory_set( ( *imaging_handle )->input_buffer, 0, - sizeof( libcstring_system_character_t ) * IMAGING_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) + sizeof( system_character_t ) * IMAGING_HANDLE_INPUT_BUFFER_SIZE ) == NULL ) { libcerror_error_set( error, @@ -160,7 +162,7 @@ int imaging_handle_initialize( } if( calculate_md5 != 0 ) { - ( *imaging_handle )->calculated_md5_hash_string = libcstring_system_string_allocate( + ( *imaging_handle )->calculated_md5_hash_string = system_string_allocate( 33 ); if( ( *imaging_handle )->calculated_md5_hash_string == NULL ) @@ -442,12 +444,12 @@ int imaging_handle_signal_abort( */ int imaging_handle_open_output( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *filename, + const system_character_t *filename, uint8_t resume, libcerror_error_t **error ) { - libcstring_system_character_t **libewf_filenames = NULL; - libcstring_system_character_t *filenames[ 1 ] = { NULL }; + system_character_t **libewf_filenames = NULL; + system_character_t *filenames[ 1 ] = { NULL }; static char *function = "imaging_handle_open_output"; size_t first_filename_length = 0; int access_flags = 0; @@ -475,15 +477,15 @@ int imaging_handle_open_output( return( -1 ); } - filenames[ 0 ] = (libcstring_system_character_t *) filename; + filenames[ 0 ] = (system_character_t *) filename; number_of_filenames = 1; if( resume != 0 ) { - first_filename_length = libcstring_system_string_length( + first_filename_length = system_string_length( filenames[ 0 ] ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, @@ -517,7 +519,7 @@ int imaging_handle_open_output( libewf_filenames = filenames; access_flags = LIBEWF_OPEN_WRITE; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( imaging_handle->output_handle, libewf_filenames, @@ -542,7 +544,7 @@ int imaging_handle_open_output( if( libewf_filenames != filenames ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -558,7 +560,7 @@ int imaging_handle_open_output( } if( libewf_filenames != filenames ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -588,12 +590,12 @@ int imaging_handle_open_output( */ int imaging_handle_open_secondary_output( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *filename, + const system_character_t *filename, uint8_t resume, libcerror_error_t **error ) { - libcstring_system_character_t **libewf_filenames = NULL; - libcstring_system_character_t *filenames[ 1 ] = { NULL }; + system_character_t **libewf_filenames = NULL; + system_character_t *filenames[ 1 ] = { NULL }; static char *function = "imaging_handle_open_secondary_output"; size_t first_filename_length = 0; int access_flags = 0; @@ -632,15 +634,15 @@ int imaging_handle_open_secondary_output( return( -1 ); } - filenames[ 0 ] = (libcstring_system_character_t *) filename; + filenames[ 0 ] = (system_character_t *) filename; number_of_filenames = 1; if( resume != 0 ) { - first_filename_length = libcstring_system_string_length( + first_filename_length = system_string_length( filenames[ 0 ] ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, @@ -687,7 +689,7 @@ int imaging_handle_open_secondary_output( if( libewf_filenames != filenames ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -701,7 +703,7 @@ int imaging_handle_open_secondary_output( } return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( imaging_handle->secondary_output_handle, libewf_filenames, @@ -730,7 +732,7 @@ int imaging_handle_open_secondary_output( if( libewf_filenames != filenames ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -746,7 +748,7 @@ int imaging_handle_open_secondary_output( } if( libewf_filenames != filenames ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -1849,8 +1851,8 @@ int imaging_handle_get_chunk_size( */ int imaging_handle_prompt_for_string( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **internal_string, + const system_character_t *request_string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { @@ -1900,7 +1902,7 @@ int imaging_handle_prompt_for_string( } *internal_string_size = IMAGING_HANDLE_STRING_SIZE; - *internal_string = libcstring_system_string_allocate( + *internal_string = system_string_allocate( *internal_string_size ); if( *internal_string == NULL ) @@ -1966,10 +1968,10 @@ int imaging_handle_prompt_for_string( */ int imaging_handle_prompt_for_compression_method( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_compression_method"; uint8_t compression_methods_amount = 0; int result = 0; @@ -2046,10 +2048,10 @@ int imaging_handle_prompt_for_compression_method( */ int imaging_handle_prompt_for_compression_level( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_compression_level"; int result = 0; @@ -2114,10 +2116,10 @@ int imaging_handle_prompt_for_compression_level( */ int imaging_handle_prompt_for_format( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_format"; int result = 0; @@ -2181,10 +2183,10 @@ int imaging_handle_prompt_for_format( */ int imaging_handle_prompt_for_media_type( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_media_type"; uint8_t default_value = 0; int result = 0; @@ -2265,10 +2267,10 @@ int imaging_handle_prompt_for_media_type( */ int imaging_handle_prompt_for_media_flags( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_media_flags"; uint8_t default_value = 0; int result = 0; @@ -2342,7 +2344,7 @@ int imaging_handle_prompt_for_media_flags( */ int imaging_handle_prompt_for_bytes_per_sector( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_bytes_per_sector"; @@ -2394,10 +2396,10 @@ int imaging_handle_prompt_for_bytes_per_sector( */ int imaging_handle_prompt_for_sectors_per_chunk( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { - libcstring_system_character_t *fixed_string_variable = NULL; + system_character_t *fixed_string_variable = NULL; static char *function = "imaging_handle_prompt_for_sectors_per_chunk"; int result = 0; @@ -2461,7 +2463,7 @@ int imaging_handle_prompt_for_sectors_per_chunk( */ int imaging_handle_prompt_for_sector_error_granularity( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_sector_error_granularity"; @@ -2517,7 +2519,7 @@ int imaging_handle_prompt_for_sector_error_granularity( */ int imaging_handle_prompt_for_maximum_segment_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_maximum_segment_size"; @@ -2581,7 +2583,7 @@ int imaging_handle_prompt_for_maximum_segment_size( */ int imaging_handle_prompt_for_acquiry_offset( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_acquiry_offset"; @@ -2631,7 +2633,7 @@ int imaging_handle_prompt_for_acquiry_offset( */ int imaging_handle_prompt_for_acquiry_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ) { static char *function = "imaging_handle_prompt_for_acquiry_size"; @@ -2930,8 +2932,8 @@ int imaging_handle_get_output_values( */ int imaging_handle_set_string( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, - libcstring_system_character_t **internal_string, + const system_character_t *string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ) { @@ -2990,12 +2992,12 @@ int imaging_handle_set_string( *internal_string = NULL; *internal_string_size = 0; } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length > 0 ) { - *internal_string = libcstring_system_string_allocate( + *internal_string = system_string_allocate( string_length + 1 ); if( *internal_string == NULL ) @@ -3009,7 +3011,7 @@ int imaging_handle_set_string( goto on_error; } - if( libcstring_system_string_copy( + if( system_string_copy( *internal_string, string, string_length ) == NULL ) @@ -3047,10 +3049,10 @@ int imaging_handle_set_string( */ int imaging_handle_set_compression_values( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { - libcstring_system_character_t *string_segment = NULL; + system_character_t *string_segment = NULL; static char *function = "imaging_handle_set_compression_values"; size_t string_segment_size = 0; size_t string_length = 0; @@ -3058,7 +3060,7 @@ int imaging_handle_set_compression_values( int result = 0; int segment_index = 0; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; @@ -3075,10 +3077,10 @@ int imaging_handle_set_compression_values( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, @@ -3103,7 +3105,7 @@ int imaging_handle_set_compression_values( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, @@ -3138,7 +3140,7 @@ int imaging_handle_set_compression_values( } if( number_of_segments == 2 ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, @@ -3205,7 +3207,7 @@ int imaging_handle_set_compression_values( } segment_index++; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, @@ -3260,7 +3262,7 @@ int imaging_handle_set_compression_values( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) @@ -3284,7 +3286,7 @@ int imaging_handle_set_compression_values( on_error: if( string_elements != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); @@ -3302,7 +3304,7 @@ int imaging_handle_set_compression_values( */ int imaging_handle_set_format( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_format"; @@ -3343,7 +3345,7 @@ int imaging_handle_set_format( */ int imaging_handle_set_media_type( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_media_type"; @@ -3384,7 +3386,7 @@ int imaging_handle_set_media_type( */ int imaging_handle_set_media_flags( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_media_flags"; @@ -3425,7 +3427,7 @@ int imaging_handle_set_media_flags( */ int imaging_handle_set_bytes_per_sector( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_bytes_per_sector"; @@ -3444,7 +3446,7 @@ int imaging_handle_set_bytes_per_sector( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); result = byte_size_string_convert( @@ -3483,7 +3485,7 @@ int imaging_handle_set_bytes_per_sector( */ int imaging_handle_set_sectors_per_chunk( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_sectors_per_chunk"; @@ -3524,7 +3526,7 @@ int imaging_handle_set_sectors_per_chunk( */ int imaging_handle_set_sector_error_granularity( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_sector_error_granularity"; @@ -3543,7 +3545,7 @@ int imaging_handle_set_sector_error_granularity( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); result = byte_size_string_convert( @@ -3582,7 +3584,7 @@ int imaging_handle_set_sector_error_granularity( */ int imaging_handle_set_maximum_segment_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_maximum_segment_size"; @@ -3600,7 +3602,7 @@ int imaging_handle_set_maximum_segment_size( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); result = byte_size_string_convert( @@ -3653,7 +3655,7 @@ int imaging_handle_set_maximum_segment_size( */ int imaging_handle_set_acquiry_offset( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_acquiry_offset"; @@ -3682,9 +3684,9 @@ int imaging_handle_set_acquiry_offset( return( -1 ); } - if( string[ 0 ] != (libcstring_system_character_t) '-' ) + if( string[ 0 ] != (system_character_t) '-' ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( @@ -3712,7 +3714,7 @@ int imaging_handle_set_acquiry_offset( */ int imaging_handle_set_acquiry_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_acquiry_size"; @@ -3741,9 +3743,9 @@ int imaging_handle_set_acquiry_size( return( -1 ); } - if( string[ 0 ] != (libcstring_system_character_t) '-' ) + if( string[ 0 ] != (system_character_t) '-' ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( ewftools_system_string_decimal_copy_to_64_bit( @@ -3771,7 +3773,7 @@ int imaging_handle_set_acquiry_size( */ int imaging_handle_set_header_codepage( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_header_codepage"; @@ -3812,7 +3814,7 @@ int imaging_handle_set_header_codepage( */ int imaging_handle_set_process_buffer_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "imaging_handle_set_process_buffer_size"; @@ -3831,7 +3833,7 @@ int imaging_handle_set_process_buffer_size( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); result = byte_size_string_convert( @@ -3872,10 +3874,10 @@ int imaging_handle_set_process_buffer_size( */ int imaging_handle_set_additional_digest_types( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { - libcstring_system_character_t *string_segment = NULL; + system_character_t *string_segment = NULL; static char *function = "imaging_handle_set_additional_digest_types"; size_t string_length = 0; size_t string_segment_size = 0; @@ -3885,7 +3887,7 @@ int imaging_handle_set_additional_digest_types( int result = 0; int segment_index = 0; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; @@ -3902,10 +3904,10 @@ int imaging_handle_set_additional_digest_types( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, @@ -3930,7 +3932,7 @@ int imaging_handle_set_additional_digest_types( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, @@ -3955,7 +3957,7 @@ int imaging_handle_set_additional_digest_types( segment_index < number_of_segments; segment_index++ ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, @@ -3995,16 +3997,16 @@ int imaging_handle_set_additional_digest_types( } if( string_segment_size == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha1" ), + _SYSTEM_STRING( "sha1" ), 4 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA1" ), + _SYSTEM_STRING( "SHA1" ), 4 ) == 0 ) { calculate_sha1 = 1; @@ -4012,30 +4014,30 @@ int imaging_handle_set_additional_digest_types( } else if( string_segment_size == 6 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha-1" ), + _SYSTEM_STRING( "sha-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha_1" ), + _SYSTEM_STRING( "sha_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA-1" ), + _SYSTEM_STRING( "SHA-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA_1" ), + _SYSTEM_STRING( "SHA_1" ), 5 ) == 0 ) { calculate_sha1 = 1; @@ -4043,16 +4045,16 @@ int imaging_handle_set_additional_digest_types( } else if( string_segment_size == 7 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha256" ), + _SYSTEM_STRING( "sha256" ), 6 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA256" ), + _SYSTEM_STRING( "SHA256" ), 6 ) == 0 ) { calculate_sha256 = 1; @@ -4060,30 +4062,30 @@ int imaging_handle_set_additional_digest_types( } else if( string_segment_size == 8 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha-256" ), + _SYSTEM_STRING( "sha-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha_256" ), + _SYSTEM_STRING( "sha_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA-256" ), + _SYSTEM_STRING( "SHA-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA_256" ), + _SYSTEM_STRING( "SHA_256" ), 7 ) == 0 ) { calculate_sha256 = 1; @@ -4093,7 +4095,7 @@ int imaging_handle_set_additional_digest_types( if( ( calculate_sha1 != 0 ) && ( imaging_handle->calculate_sha1 == 0 ) ) { - imaging_handle->calculated_sha1_hash_string = libcstring_system_string_allocate( + imaging_handle->calculated_sha1_hash_string = system_string_allocate( 41 ); if( imaging_handle->calculated_sha1_hash_string == NULL ) @@ -4112,7 +4114,7 @@ int imaging_handle_set_additional_digest_types( if( ( calculate_sha256 != 0 ) && ( imaging_handle->calculate_sha256 == 0 ) ) { - imaging_handle->calculated_sha256_hash_string = libcstring_system_string_allocate( + imaging_handle->calculated_sha256_hash_string = system_string_allocate( 65 ); if( imaging_handle->calculated_sha256_hash_string == NULL ) @@ -4128,7 +4130,7 @@ int imaging_handle_set_additional_digest_types( } imaging_handle->calculate_sha256 = 1; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) @@ -4152,7 +4154,7 @@ int imaging_handle_set_additional_digest_types( on_error: if( string_elements != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); @@ -4175,13 +4177,13 @@ int imaging_handle_set_additional_digest_types( */ int imaging_handle_set_output_values( imaging_handle_t *imaging_handle, - libcstring_system_character_t *acquiry_software, - libcstring_system_character_t *acquiry_software_version, - libcstring_system_character_t *model, - libcstring_system_character_t *serial_number, + system_character_t *acquiry_software, + system_character_t *acquiry_software_version, + system_character_t *model, + system_character_t *serial_number, libcerror_error_t **error ) { - libcstring_system_character_t acquiry_operating_system[ 32 ]; + system_character_t acquiry_operating_system[ 32 ]; #if defined( HAVE_GUID_SUPPORT ) || defined( WINAPI ) uint8_t guid[ GUID_SIZE ]; @@ -4825,7 +4827,7 @@ int imaging_handle_get_header_value( imaging_handle_t *imaging_handle, const uint8_t *identifier, size_t identifier_size, - libcstring_system_character_t **header_value, + system_character_t **header_value, size_t *header_value_size, libcerror_error_t **error ) { @@ -4873,7 +4875,7 @@ int imaging_handle_get_header_value( *header_value = NULL; *header_value_size = 0; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value_size( imaging_handle->output_handle, identifier, @@ -4903,7 +4905,7 @@ int imaging_handle_get_header_value( if( ( result != 0 ) && ( *header_value_size > 0 ) ) { - *header_value = libcstring_system_string_allocate( + *header_value = system_string_allocate( *header_value_size ); if( *header_value == NULL ) @@ -4918,7 +4920,7 @@ int imaging_handle_get_header_value( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( imaging_handle->output_handle, identifier, @@ -4970,7 +4972,7 @@ int imaging_handle_set_header_value( imaging_handle_t *imaging_handle, const uint8_t *identifier, size_t identifier_length, - const libcstring_system_character_t *header_value, + const system_character_t *header_value, libcerror_error_t **error ) { static char *function = "imaging_handle_set_header_value"; @@ -4999,12 +5001,12 @@ int imaging_handle_set_header_value( return( -1 ); } - header_value_length = libcstring_system_string_length( + header_value_length = system_string_length( header_value ); if( header_value_length > 0 ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( imaging_handle->output_handle, identifier, @@ -5035,7 +5037,7 @@ int imaging_handle_set_header_value( } if( imaging_handle->secondary_output_handle != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_set_utf16_header_value( imaging_handle->secondary_output_handle, identifier, @@ -5076,7 +5078,7 @@ int imaging_handle_set_hash_value( imaging_handle_t *imaging_handle, char *hash_value_identifier, size_t hash_value_identifier_length, - libcstring_system_character_t *hash_value, + system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ) { @@ -5516,8 +5518,8 @@ int imaging_handle_print_parameters( uint8_t resume_acquiry, libcerror_error_t **error ) { - libcstring_system_character_t acquiry_size_string[ 16 ]; - libcstring_system_character_t maximum_segment_size_string[ 16 ]; + system_character_t acquiry_size_string[ 16 ]; + system_character_t maximum_segment_size_string[ 16 ]; static char *function = "imaging_handle_print_parameters"; int result = 0; @@ -5557,7 +5559,7 @@ int imaging_handle_print_parameters( } fprintf( imaging_handle->notify_stream, - "Image path and filename:\t\t%" PRIs_LIBCSTRING_SYSTEM "", + "Image path and filename:\t\t%" PRIs_SYSTEM "", imaging_handle->target_filename ); if( resume_acquiry == 0 ) @@ -5590,7 +5592,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "Secondary copy:\t\t\t\t%" PRIs_LIBCSTRING_SYSTEM "", + "Secondary copy:\t\t\t\t%" PRIs_SYSTEM "", imaging_handle->secondary_target_filename ); if( resume_acquiry == 0 ) @@ -5627,7 +5629,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", imaging_handle->case_number ); } fprintf( @@ -5642,7 +5644,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", imaging_handle->description ); } fprintf( @@ -5657,7 +5659,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", imaging_handle->evidence_number ); } fprintf( @@ -5672,7 +5674,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", imaging_handle->examiner_name ); } fprintf( @@ -5687,7 +5689,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", imaging_handle->notes ); } fprintf( @@ -5945,7 +5947,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM " (%" PRIu64 " bytes)", + "%" PRIs_SYSTEM " (%" PRIu64 " bytes)", acquiry_size_string, imaging_handle->acquiry_size ); } @@ -5976,7 +5978,7 @@ int imaging_handle_print_parameters( { fprintf( imaging_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM " (%" PRIu64 " bytes)", + "%" PRIs_SYSTEM " (%" PRIu64 " bytes)", maximum_segment_size_string, imaging_handle->maximum_segment_size ); } @@ -6074,21 +6076,21 @@ int imaging_handle_print_hashes( { fprintf( stream, - "MD5 hash calculated over data:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "MD5 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", imaging_handle->calculated_md5_hash_string ); } if( imaging_handle->calculate_sha1 != 0 ) { fprintf( stream, - "SHA1 hash calculated over data:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA1 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", imaging_handle->calculated_sha1_hash_string ); } if( imaging_handle->calculate_sha256 != 0 ) { fprintf( stream, - "SHA256 hash calculated over data:\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA256 hash calculated over data:\t%" PRIs_SYSTEM "\n", imaging_handle->calculated_sha256_hash_string ); } return( 1 ); diff --git a/ewftools/imaging_handle.h b/ewftools/imaging_handle.h index 6086aef..f634e16 100644 --- a/ewftools/imaging_handle.h +++ b/ewftools/imaging_handle.h @@ -27,7 +27,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "storage_media_buffer.h" @@ -42,11 +41,11 @@ struct imaging_handle { /* The user input buffer */ - libcstring_system_character_t *input_buffer; + system_character_t *input_buffer; /* The target filename */ - libcstring_system_character_t *target_filename; + system_character_t *target_filename; /* The target filename size */ @@ -54,7 +53,7 @@ struct imaging_handle /* The secondary target filename */ - libcstring_system_character_t *secondary_target_filename; + system_character_t *secondary_target_filename; /* The secondary target filename size */ @@ -66,7 +65,7 @@ struct imaging_handle /* The case number */ - libcstring_system_character_t *case_number; + system_character_t *case_number; /* The case number size */ @@ -74,7 +73,7 @@ struct imaging_handle /* The description */ - libcstring_system_character_t *description; + system_character_t *description; /* The description size */ @@ -82,7 +81,7 @@ struct imaging_handle /* The evidence number */ - libcstring_system_character_t *evidence_number; + system_character_t *evidence_number; /* The evidence number size */ @@ -90,7 +89,7 @@ struct imaging_handle /* The examiner name */ - libcstring_system_character_t *examiner_name; + system_character_t *examiner_name; /* The examiner name size */ @@ -98,7 +97,7 @@ struct imaging_handle /* The notes */ - libcstring_system_character_t *notes; + system_character_t *notes; /* The notes size */ @@ -166,7 +165,7 @@ struct imaging_handle /* The calculated MD5 digest hash string */ - libcstring_system_character_t *calculated_md5_hash_string; + system_character_t *calculated_md5_hash_string; /* Value to indicate if the SHA1 digest hash should be calculated */ @@ -182,7 +181,7 @@ struct imaging_handle /* The calculated SHA1 digest hash string */ - libcstring_system_character_t *calculated_sha1_hash_string; + system_character_t *calculated_sha1_hash_string; /* Value to indicate if the SHA256 digest hash should be calculated */ @@ -202,7 +201,7 @@ struct imaging_handle /* The calculated SHA256 digest hash string */ - libcstring_system_character_t *calculated_sha256_hash_string; + system_character_t *calculated_sha256_hash_string; /* The libewf output handle */ @@ -245,13 +244,13 @@ int imaging_handle_signal_abort( int imaging_handle_open_output( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *filename, + const system_character_t *filename, uint8_t resume, libcerror_error_t **error ); int imaging_handle_open_secondary_output( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *filename, + const system_character_t *filename, uint8_t resume, libcerror_error_t **error ); @@ -318,64 +317,64 @@ int imaging_handle_get_chunk_size( int imaging_handle_prompt_for_string( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, - libcstring_system_character_t **internal_string, + const system_character_t *request_string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ); int imaging_handle_prompt_for_compression_method( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_compression_level( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_format( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_media_type( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_media_flags( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_bytes_per_sector( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_sectors_per_chunk( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_sector_error_granularity( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_maximum_segment_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_acquiry_offset( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_prompt_for_acquiry_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *request_string, + const system_character_t *request_string, libcerror_error_t **error ); int imaging_handle_get_output_values( @@ -384,89 +383,89 @@ int imaging_handle_get_output_values( int imaging_handle_set_string( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, - libcstring_system_character_t **internal_string, + const system_character_t *string, + system_character_t **internal_string, size_t *internal_string_size, libcerror_error_t **error ); int imaging_handle_set_compression_values( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_format( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_media_type( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_media_flags( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_bytes_per_sector( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_sectors_per_chunk( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_sector_error_granularity( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_maximum_segment_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_acquiry_offset( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_acquiry_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_header_codepage( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_process_buffer_size( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_additional_digest_types( imaging_handle_t *imaging_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int imaging_handle_set_output_values( imaging_handle_t *imaging_handle, - libcstring_system_character_t *acquiry_software, - libcstring_system_character_t *acquiry_software_version, - libcstring_system_character_t *model, - libcstring_system_character_t *serial_number, + system_character_t *acquiry_software, + system_character_t *acquiry_software_version, + system_character_t *model, + system_character_t *serial_number, libcerror_error_t **error ); int imaging_handle_get_header_value( imaging_handle_t *imaging_handle, const uint8_t *identifier, size_t identifier_size, - libcstring_system_character_t **header_value, + system_character_t **header_value, size_t *header_value_size, libcerror_error_t **error ); @@ -474,14 +473,14 @@ int imaging_handle_set_header_value( imaging_handle_t *imaging_handle, const uint8_t *identifier, size_t identifier_length, - const libcstring_system_character_t *header_value, + const system_character_t *header_value, libcerror_error_t **error ); int imaging_handle_set_hash_value( imaging_handle_t *imaging_handle, char *hash_value_identifier, size_t hash_value_identifier_length, - libcstring_system_character_t *hash_value, + system_character_t *hash_value, size_t hash_value_length, libcerror_error_t **error ); diff --git a/ewftools/info_handle.c b/ewftools/info_handle.c index c45504d..967af7e 100644 --- a/ewftools/info_handle.c +++ b/ewftools/info_handle.c @@ -22,7 +22,10 @@ #include #include #include +#include +#include #include +#include #if defined( HAVE_SYS_UTSNAME_H ) #include @@ -33,7 +36,6 @@ #include "ewfinput.h" #include "ewftools_libcerror.h" #include "ewftools_libcsplit.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "guid.h" #include "info_handle.h" @@ -266,11 +268,11 @@ int info_handle_set_maximum_number_of_open_handles( */ int info_handle_open_input( info_handle_t *info_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { - libcstring_system_character_t **libewf_filenames = NULL; + system_character_t **libewf_filenames = NULL; static char *function = "info_handle_open_input"; size_t first_filename_length = 0; int filename_index = 0; @@ -321,10 +323,10 @@ int info_handle_open_input( } if( number_of_filenames == 1 ) { - first_filename_length = libcstring_system_string_length( + first_filename_length = system_string_length( filenames[ 0 ] ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, @@ -351,9 +353,9 @@ int info_handle_open_input( goto on_error; } - filenames = (libcstring_system_character_t * const *) libewf_filenames; + filenames = (system_character_t * const *) libewf_filenames; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( info_handle->input_handle, filenames, @@ -390,7 +392,7 @@ int info_handle_open_input( { fprintf( info_handle->notify_stream, - "\t\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\t\t\t%" PRIs_SYSTEM "\n", filenames[ filename_index ] ); } fprintf( @@ -416,7 +418,7 @@ int info_handle_open_input( } if( libewf_filenames != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -444,7 +446,7 @@ int info_handle_open_input( on_error: if( libewf_filenames != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -511,7 +513,7 @@ int info_handle_close( */ int info_handle_set_output_format( info_handle_t *info_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "info_handle_set_output_format"; @@ -529,14 +531,14 @@ int info_handle_set_output_format( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 4 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "text" ), + _SYSTEM_STRING( "text" ), 4 ) == 0 ) { info_handle->output_format = INFO_HANDLE_OUTPUT_FORMAT_TEXT; @@ -545,9 +547,9 @@ int info_handle_set_output_format( } else if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "dfxml" ), + _SYSTEM_STRING( "dfxml" ), 5 ) == 0 ) { info_handle->output_format = INFO_HANDLE_OUTPUT_FORMAT_DFXML; @@ -574,7 +576,7 @@ int info_handle_set_output_format( */ int info_handle_set_date_format( info_handle_t *info_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "info_handle_set_date_format"; @@ -592,22 +594,22 @@ int info_handle_set_date_format( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 2 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "dm" ), + _SYSTEM_STRING( "dm" ), 2 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_DAYMONTH; result = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "md" ), + _SYSTEM_STRING( "md" ), 3 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_MONTHDAY; @@ -616,9 +618,9 @@ int info_handle_set_date_format( } else if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "ctime" ), + _SYSTEM_STRING( "ctime" ), 5 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_CTIME; @@ -627,9 +629,9 @@ int info_handle_set_date_format( } else if( string_length == 7 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "iso8601" ), + _SYSTEM_STRING( "iso8601" ), 7 ) == 0 ) { info_handle->date_format = LIBEWF_DATE_FORMAT_ISO8601; @@ -655,7 +657,7 @@ int info_handle_set_date_format( */ int info_handle_set_header_codepage( info_handle_t *info_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "info_handle_set_header_codepage"; @@ -796,7 +798,7 @@ int info_handle_section_value_string_fprint( size_t identifier_length, const char *description, size_t description_length, - const libcstring_system_character_t *value_string, + const system_character_t *value_string, libcerror_error_t **error ) { static char *function = "info_handle_section_value_string_fprint"; @@ -816,7 +818,7 @@ int info_handle_section_value_string_fprint( { if( identifier_length == 12 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( identifier, "acquiry_date", 12 ) == 0 ) @@ -826,7 +828,7 @@ int info_handle_section_value_string_fprint( } else if( identifier_length == 16 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( identifier, "acquiry_software", 16 ) == 0 ) @@ -836,14 +838,14 @@ int info_handle_section_value_string_fprint( } else if( identifier_length == 24 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( identifier, "acquiry_operating_system", 24 ) == 0 ) { identifier = "acquisition_system"; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( identifier, "acquiry_software_version", 24 ) == 0 ) @@ -853,7 +855,7 @@ int info_handle_section_value_string_fprint( } fprintf( info_handle->notify_stream, - "\t\t\t<%s>%" PRIs_LIBCSTRING_SYSTEM "\n", + "\t\t\t<%s>%" PRIs_SYSTEM "\n", identifier, value_string, identifier ); @@ -877,7 +879,7 @@ int info_handle_section_value_string_fprint( } fprintf( info_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "\n", + "%" PRIs_SYSTEM "\n", value_string ); } return( 1 ); @@ -1010,7 +1012,7 @@ int info_handle_section_value_size_fprint( size64_t value_size, libcerror_error_t **error ) { - libcstring_system_character_t value_size_string[ 16 ]; + system_character_t value_size_string[ 16 ]; static char *function = "info_handle_section_value_size_fprint"; int result = 0; @@ -1063,7 +1065,7 @@ int info_handle_section_value_size_fprint( { fprintf( info_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM " (%" PRIu64 " bytes)\n", + "%" PRIs_SYSTEM " (%" PRIu64 " bytes)\n", value_size_string, value_size ); } @@ -1165,7 +1167,7 @@ int info_handle_header_value_fprint( size_t description_length, libcerror_error_t **error ) { - libcstring_system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; + system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; static char *function = "info_handle_header_value_fprint"; size_t header_value_size = INFO_HANDLE_VALUE_SIZE; @@ -1182,7 +1184,7 @@ int info_handle_header_value_fprint( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) identifier, @@ -1390,7 +1392,7 @@ int info_handle_header_values_fprint( if( header_value_identifier_size == 6 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "model", 5 ) == 0 ) @@ -1398,7 +1400,7 @@ int info_handle_header_values_fprint( description = "Model"; description_length = 5; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( header_value_identifier, "notes", 5 ) == 0 ) @@ -1411,7 +1413,7 @@ int info_handle_header_values_fprint( { /* TODO figure out what this value represents */ - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "unknown_dc", 10 ) == 0 ) @@ -1422,7 +1424,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 12 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "case_number", 11 ) == 0 ) @@ -1430,7 +1432,7 @@ int info_handle_header_values_fprint( description = "Case number"; description_length = 11; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( header_value_identifier, "description", 11 ) == 0 ) @@ -1438,7 +1440,7 @@ int info_handle_header_values_fprint( description = "Description"; description_length = 11; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( header_value_identifier, "system_date", 11 ) == 0 ) @@ -1449,7 +1451,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 13 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "acquiry_date", 12 ) == 0 ) @@ -1457,7 +1459,7 @@ int info_handle_header_values_fprint( description = "Acquisition date"; description_length = 16; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( header_value_identifier, "device_label", 12 ) == 0 ) @@ -1468,7 +1470,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 14 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "examiner_name", 13 ) == 0 ) @@ -1476,7 +1478,7 @@ int info_handle_header_values_fprint( description = "Examiner name"; description_length = 13; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( header_value_identifier, "serial_number", 13 ) == 0 ) @@ -1487,7 +1489,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 16 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "evidence_number", 15 ) == 0 ) @@ -1498,7 +1500,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 17 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "acquiry_software", 16 ) == 0 ) @@ -1509,7 +1511,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 19 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "process_identifier", 18 ) == 0 ) @@ -1520,7 +1522,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 25 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "acquiry_operating_system", 24 ) == 0 ) @@ -1528,7 +1530,7 @@ int info_handle_header_values_fprint( description = "Operating system used"; description_length = 21; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( header_value_identifier, "acquiry_software_version", 24 ) == 0 ) @@ -1541,7 +1543,7 @@ int info_handle_header_values_fprint( { if( header_value_identifier_size == 8 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "extents", 7 ) == 0 ) @@ -1563,7 +1565,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 9 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "password", 8 ) == 0 ) @@ -1585,7 +1587,7 @@ int info_handle_header_values_fprint( } else if( header_value_identifier_size == 18 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( header_value_identifier, "compression_level", 17 ) == 0 ) @@ -1658,7 +1660,7 @@ int info_handle_header_value_password_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { - libcstring_system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; + system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; static char *function = "info_handle_header_value_password_fprint"; size_t header_value_size = INFO_HANDLE_VALUE_SIZE; @@ -1675,7 +1677,7 @@ int info_handle_header_value_password_fprint( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) "password", @@ -1718,14 +1720,14 @@ int info_handle_header_value_password_fprint( { fprintf( info_handle->notify_stream, - "\t\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\t\t\t%" PRIs_SYSTEM "\n", header_value ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, - "\tPassword:\t\t(hash: %" PRIs_LIBCSTRING_SYSTEM ")\n", + "\tPassword:\t\t(hash: %" PRIs_SYSTEM ")\n", header_value ); } } @@ -1739,9 +1741,9 @@ int info_handle_header_value_compression_level_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { - libcstring_system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; + system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; - const libcstring_system_character_t *value_string = NULL; + const system_character_t *value_string = NULL; static char *function = "info_handle_header_value_compression_level_fprint"; size_t header_value_size = INFO_HANDLE_VALUE_SIZE; int result = 0; @@ -1757,7 +1759,7 @@ int info_handle_header_value_compression_level_fprint( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) "compression_level", @@ -1787,30 +1789,30 @@ int info_handle_header_value_compression_level_fprint( } else if( result != 0 ) { - if( libcstring_system_string_compare( + if( system_string_compare( header_value, - _LIBCSTRING_SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE ), + _SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_NONE ), 1 ) == 0 ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "no compression" ); + value_string = _SYSTEM_STRING( "no compression" ); } - else if( libcstring_system_string_compare( + else if( system_string_compare( header_value, - _LIBCSTRING_SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST ), + _SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_FAST ), 1 ) == 0 ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "good (fast) compression" ); + value_string = _SYSTEM_STRING( "good (fast) compression" ); } - else if( libcstring_system_string_compare( + else if( system_string_compare( header_value, - _LIBCSTRING_SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST ), + _SYSTEM_STRING( LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST ), 1 ) == 0 ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "best compression" ); + value_string = _SYSTEM_STRING( "best compression" ); } else { - value_string = _LIBCSTRING_SYSTEM_STRING( "unknown compression" ); + value_string = _SYSTEM_STRING( "unknown compression" ); } if( info_handle_section_value_string_fprint( info_handle, @@ -1841,9 +1843,9 @@ int info_handle_header_value_extents_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { - libcstring_system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; + system_character_t header_value[ INFO_HANDLE_VALUE_SIZE ]; - libcstring_system_character_t *string_segment = NULL; + system_character_t *string_segment = NULL; static char *function = "info_handle_header_value_extents_fprint"; size_t header_value_length = 0; size_t header_value_size = INFO_HANDLE_VALUE_SIZE; @@ -1852,7 +1854,7 @@ int info_handle_header_value_extents_fprint( int result = 0; int segment_index = 0; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *extents_elements = NULL; #else libcsplit_narrow_split_string_t *extents_elements = NULL; @@ -1869,7 +1871,7 @@ int info_handle_header_value_extents_fprint( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_header_value( info_handle->input_handle, (uint8_t *) "extents", @@ -1901,10 +1903,10 @@ int info_handle_header_value_extents_fprint( { /* Need the effective length of the string */ - header_value_length = libcstring_system_string_length( + header_value_length = system_string_length( header_value ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( header_value, header_value_length + 1, @@ -1929,7 +1931,7 @@ int info_handle_header_value_extents_fprint( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( extents_elements, &number_of_segments, @@ -1963,7 +1965,7 @@ int info_handle_header_value_extents_fprint( } if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( extents_elements, 0, @@ -1992,7 +1994,7 @@ int info_handle_header_value_extents_fprint( { fprintf( info_handle->notify_stream, - "\tExtents:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\tExtents:\t\t%" PRIs_SYSTEM "\n", string_segment ); } } @@ -2021,7 +2023,7 @@ int info_handle_header_value_extents_fprint( "" ); } } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( extents_elements, segment_index, @@ -2051,7 +2053,7 @@ int info_handle_header_value_extents_fprint( { fprintf( info_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", string_segment ); } if( ( segment_index % 4 ) != 0 ) @@ -2080,7 +2082,7 @@ int info_handle_header_value_extents_fprint( "\t\t\t\n" ); } } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &extents_elements, error ) != 1 ) @@ -2105,7 +2107,7 @@ int info_handle_header_value_extents_fprint( on_error: if( extents_elements != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &extents_elements, NULL ); @@ -2125,10 +2127,10 @@ int info_handle_media_information_fprint( info_handle_t *info_handle, libcerror_error_t **error ) { - libcstring_system_character_t guid_string[ 48 ]; + system_character_t guid_string[ 48 ]; uint8_t guid[ GUID_SIZE ]; - const libcstring_system_character_t *value_string = NULL; + const system_character_t *value_string = NULL; static char *function = "info_handle_media_information_fprint"; size64_t media_size = 0; uint64_t value_64bit = 0; @@ -2143,7 +2145,7 @@ int info_handle_media_information_fprint( int result = 1; /* experimental version only - libcstring_system_character_t segment_file_version[ 4 ] = { '0', '.', '0', 0 }; + system_character_t segment_file_version[ 4 ] = { '0', '.', '0', 0 }; uint16_t compression_method = 0; uint8_t major_version = 0; uint8_t minor_version = 0; @@ -2220,90 +2222,90 @@ int info_handle_media_information_fprint( switch( format ) { case LIBEWF_FORMAT_EWF: - value_string = _LIBCSTRING_SYSTEM_STRING( "original EWF" ); + value_string = _SYSTEM_STRING( "original EWF" ); break; case LIBEWF_FORMAT_SMART: - value_string = _LIBCSTRING_SYSTEM_STRING( "SMART" ); + value_string = _SYSTEM_STRING( "SMART" ); break; case LIBEWF_FORMAT_FTK: - value_string = _LIBCSTRING_SYSTEM_STRING( "FTK Imager" ); + value_string = _SYSTEM_STRING( "FTK Imager" ); break; case LIBEWF_FORMAT_ENCASE1: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 1" ); + value_string = _SYSTEM_STRING( "EnCase 1" ); break; case LIBEWF_FORMAT_ENCASE2: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 2" ); + value_string = _SYSTEM_STRING( "EnCase 2" ); break; case LIBEWF_FORMAT_ENCASE3: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 3" ); + value_string = _SYSTEM_STRING( "EnCase 3" ); break; case LIBEWF_FORMAT_ENCASE4: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 4" ); + value_string = _SYSTEM_STRING( "EnCase 4" ); break; case LIBEWF_FORMAT_ENCASE5: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 5" ); + value_string = _SYSTEM_STRING( "EnCase 5" ); break; case LIBEWF_FORMAT_ENCASE6: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 6" ); + value_string = _SYSTEM_STRING( "EnCase 6" ); break; /* experimental version only case LIBEWF_FORMAT_ENCASE7: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 7" ); + value_string = _SYSTEM_STRING( "EnCase 7" ); break; */ case LIBEWF_FORMAT_LINEN5: - value_string = _LIBCSTRING_SYSTEM_STRING( "linen 5" ); + value_string = _SYSTEM_STRING( "linen 5" ); break; case LIBEWF_FORMAT_LINEN6: - value_string = _LIBCSTRING_SYSTEM_STRING( "linen 6" ); + value_string = _SYSTEM_STRING( "linen 6" ); break; /* experimental version only case LIBEWF_FORMAT_LINEN7: - value_string = _LIBCSTRING_SYSTEM_STRING( "linen 7" ); + value_string = _SYSTEM_STRING( "linen 7" ); break; */ case LIBEWF_FORMAT_EWFX: - value_string = _LIBCSTRING_SYSTEM_STRING( "EWFX (extended EWF)" ); + value_string = _SYSTEM_STRING( "EWFX (extended EWF)" ); break; case LIBEWF_FORMAT_LOGICAL_ENCASE5: - value_string = _LIBCSTRING_SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 5" ); + value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 5" ); break; case LIBEWF_FORMAT_LOGICAL_ENCASE6: - value_string = _LIBCSTRING_SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 6" ); + value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 6" ); break; case LIBEWF_FORMAT_LOGICAL_ENCASE7: - value_string = _LIBCSTRING_SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 7" ); + value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 7" ); break; /* experimental version only case LIBEWF_FORMAT_V2_ENCASE7: - value_string = _LIBCSTRING_SYSTEM_STRING( "EnCase 7 (version 2)" ); + value_string = _SYSTEM_STRING( "EnCase 7 (version 2)" ); break; case LIBEWF_FORMAT_V2_LOGICAL_ENCASE7: - value_string = _LIBCSTRING_SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 7 (version 2)" ); + value_string = _SYSTEM_STRING( "Logical Evidence File (LEF) EnCase 7 (version 2)" ); break; */ case LIBEWF_FORMAT_UNKNOWN: default: - value_string = _LIBCSTRING_SYSTEM_STRING( "unknown" ); + value_string = _SYSTEM_STRING( "unknown" ); break; } @@ -2468,12 +2470,12 @@ int info_handle_media_information_fprint( if( compression_method == LIBEWF_COMPRESSION_METHOD_DEFLATE ) */ { - value_string = _LIBCSTRING_SYSTEM_STRING( "deflate" ); + value_string = _SYSTEM_STRING( "deflate" ); } /* experimental version only else if( compression_method == LIBEWF_COMPRESSION_METHOD_BZIP2 ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "bzip2" ); + value_string = _SYSTEM_STRING( "bzip2" ); } */ if( info_handle_section_value_string_fprint( @@ -2516,19 +2518,19 @@ int info_handle_media_information_fprint( { if( compression_level == LIBEWF_COMPRESSION_NONE ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "no compression" ); + value_string = _SYSTEM_STRING( "no compression" ); } else if( compression_level == LIBEWF_COMPRESSION_FAST ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "good (fast) compression" ); + value_string = _SYSTEM_STRING( "good (fast) compression" ); } else if( compression_level == LIBEWF_COMPRESSION_BEST ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "best compression" ); + value_string = _SYSTEM_STRING( "best compression" ); } else { - value_string = _LIBCSTRING_SYSTEM_STRING( "unknown compression" ); + value_string = _SYSTEM_STRING( "unknown compression" ); } if( info_handle_section_value_string_fprint( info_handle, @@ -2731,27 +2733,27 @@ int info_handle_media_information_fprint( { if( media_type == LIBEWF_MEDIA_TYPE_REMOVABLE ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "removable disk" ); + value_string = _SYSTEM_STRING( "removable disk" ); } else if( media_type == LIBEWF_MEDIA_TYPE_FIXED ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "fixed disk" ); + value_string = _SYSTEM_STRING( "fixed disk" ); } else if( media_type == LIBEWF_MEDIA_TYPE_SINGLE_FILES ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "single files" ); + value_string = _SYSTEM_STRING( "single files" ); } else if( media_type == LIBEWF_MEDIA_TYPE_OPTICAL ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "optical disk (CD/DVD/BD)" ); + value_string = _SYSTEM_STRING( "optical disk (CD/DVD/BD)" ); } else if( media_type == LIBEWF_MEDIA_TYPE_MEMORY ) { - value_string = _LIBCSTRING_SYSTEM_STRING( "memory (RAM)" ); + value_string = _SYSTEM_STRING( "memory (RAM)" ); } else { - value_string = _LIBCSTRING_SYSTEM_STRING( "unknown" ); + value_string = _SYSTEM_STRING( "unknown" ); } if( info_handle_section_value_string_fprint( info_handle, @@ -2822,7 +2824,7 @@ int info_handle_media_information_fprint( 13, "Write blocked", 13, - _LIBCSTRING_SYSTEM_STRING( "Fastbloc" ), + _SYSTEM_STRING( "Fastbloc" ), error ) != 1 ) { libcerror_error_set( @@ -2843,7 +2845,7 @@ int info_handle_media_information_fprint( 13, "Write blocked", 13, - _LIBCSTRING_SYSTEM_STRING( "Tableau" ), + _SYSTEM_STRING( "Tableau" ), error ) != 1 ) { libcerror_error_set( @@ -3025,7 +3027,7 @@ int info_handle_hash_value_fprint( size_t identifier_length, libcerror_error_t **error ) { - libcstring_system_character_t hash_value[ INFO_HANDLE_VALUE_SIZE ]; + system_character_t hash_value[ INFO_HANDLE_VALUE_SIZE ]; static char *function = "info_handle_hash_value_fprint"; size_t hash_value_size = INFO_HANDLE_VALUE_SIZE; @@ -3042,7 +3044,7 @@ int info_handle_hash_value_fprint( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( info_handle->input_handle, (uint8_t *) identifier, @@ -3078,7 +3080,7 @@ int info_handle_hash_value_fprint( { if( identifier_length == 3 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( identifier, "MD5", 3 ) == 0 ) @@ -3088,7 +3090,7 @@ int info_handle_hash_value_fprint( } else if( identifier_length == 4 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( identifier, "SHA1", 4 ) == 0 ) @@ -3098,7 +3100,7 @@ int info_handle_hash_value_fprint( } fprintf( info_handle->notify_stream, - "\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\t\t%" PRIs_SYSTEM "\n", identifier, hash_value ); } @@ -3106,7 +3108,7 @@ int info_handle_hash_value_fprint( { fprintf( info_handle->notify_stream, - "\t%s:\t\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\t%s:\t\t\t%" PRIs_SYSTEM "\n", identifier, hash_value ); } @@ -3133,7 +3135,7 @@ int info_handle_hash_values_fprint( #if defined( USE_LIBEWF_GET_MD5_HASH ) digest_hash_t md5_hash[ DIGEST_HASH_SIZE_MD5 ]; - libcstring_system_character_t *stored_md5_hash_string = NULL; + system_character_t *stored_md5_hash_string = NULL; #endif if( info_handle == NULL ) @@ -3178,7 +3180,7 @@ int info_handle_hash_values_fprint( } else if( result == 1 ) { - stored_md5_hash_string = libcstring_system_string_allocate( + stored_md5_hash_string = system_string_allocate( DIGEST_HASH_STRING_SIZE_MD5 ); if( stored_md5_hash_string == NULL ) @@ -3237,14 +3239,14 @@ int info_handle_hash_values_fprint( { fprintf( info_handle->notify_stream, - "\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\t\t%" PRIs_SYSTEM "\n", stored_md5_hash_string ); } else if( info_handle->output_format == INFO_HANDLE_OUTPUT_FORMAT_TEXT ) { fprintf( info_handle->notify_stream, - "\tMD5:\t\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\tMD5:\t\t\t%" PRIs_SYSTEM "\n", stored_md5_hash_string ); } memory_free( @@ -3981,7 +3983,7 @@ int info_handle_file_entry_fprint( int indentation_level, libcerror_error_t **error ) { - libcstring_system_character_t *name = NULL; + system_character_t *name = NULL; libewf_file_entry_t *sub_file_entry = NULL; static char *function = "info_handle_file_entry_fprint"; size_t name_size = 0; @@ -4018,7 +4020,7 @@ int info_handle_file_entry_fprint( info_handle->notify_stream, "\t\t\t 0 ) { - name = libcstring_system_string_allocate( + name = system_string_allocate( name_size ); if( name == NULL ) @@ -4056,7 +4058,7 @@ int info_handle_file_entry_fprint( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name( file_entry, (uint16_t *) name, @@ -4097,7 +4099,7 @@ int info_handle_file_entry_fprint( } fprintf( info_handle->notify_stream, - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", name ); memory_free( @@ -4496,7 +4498,7 @@ int dfxml_execution_environment_fprint( struct utsname utsname_buffer; #endif #if defined( WINAPI ) - libcstring_system_character_t operating_system[ 32 ]; + system_character_t operating_system[ 32 ]; #endif static char *function = "dfxml_execution_environment_fprint"; @@ -4526,7 +4528,7 @@ int dfxml_execution_environment_fprint( { fprintf( stream, - "\t\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "\t\t\t%" PRIs_SYSTEM "\n", operating_system ); } #elif defined( HAVE_UNAME ) diff --git a/ewftools/info_handle.h b/ewftools/info_handle.h index 8bdc4b5..0c74c60 100644 --- a/ewftools/info_handle.h +++ b/ewftools/info_handle.h @@ -27,7 +27,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #if defined( __cplusplus ) @@ -84,7 +83,7 @@ int info_handle_set_maximum_number_of_open_handles( int info_handle_open_input( info_handle_t *info_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); @@ -94,17 +93,17 @@ int info_handle_close( int info_handle_set_output_format( info_handle_t *info_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int info_handle_set_date_format( info_handle_t *info_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int info_handle_set_header_codepage( info_handle_t *info_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int info_handle_section_header_fprint( @@ -124,7 +123,7 @@ int info_handle_section_value_string_fprint( size_t identifier_length, const char *description, size_t description_length, - const libcstring_system_character_t *value_string, + const system_character_t *value_string, libcerror_error_t **error ); int info_handle_section_value_32bit_fprint( diff --git a/ewftools/log_handle.h b/ewftools/log_handle.h index 35f2fed..925ad91 100644 --- a/ewftools/log_handle.h +++ b/ewftools/log_handle.h @@ -27,7 +27,6 @@ #include #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #if defined( __cplusplus ) extern "C" { @@ -52,7 +51,7 @@ int log_handle_free( int log_handle_open( log_handle_t *log_handle, - const libcstring_system_character_t *filename, + const system_character_t *filename, libcerror_error_t **error ); int log_handle_close( diff --git a/ewftools/process_status.c b/ewftools/process_status.c index 8938237..d06ae92 100644 --- a/ewftools/process_status.c +++ b/ewftools/process_status.c @@ -21,6 +21,7 @@ #include #include +#include #include #if defined( TIME_WITH_SYS_TIME ) @@ -36,7 +37,6 @@ #include "ewftools_libcdatetime.h" #include "ewftools_libcerror.h" #include "ewftools_libcnotify.h" -#include "ewftools_libcstring.h" #include "process_status.h" /* Creates process status information @@ -45,9 +45,9 @@ */ int process_status_initialize( process_status_t **process_status, - const libcstring_system_character_t *status_process_string, - const libcstring_system_character_t *status_update_string, - const libcstring_system_character_t *status_summary_string, + const system_character_t *status_process_string, + const system_character_t *status_update_string, + const system_character_t *status_summary_string, FILE *output_stream, uint8_t print_status_information, libcerror_error_t **error ) @@ -244,7 +244,7 @@ int process_status_start( process_status_t *process_status, libcerror_error_t **error ) { - libcstring_system_character_t time_string[ 32 ]; + system_character_t time_string[ 32 ]; static char *function = "process_status_start"; @@ -315,7 +315,7 @@ int process_status_start( { fprintf( process_status->output_stream, - "%" PRIs_LIBCSTRING_SYSTEM " started at: %" PRIs_LIBCSTRING_SYSTEM "\n", + "%" PRIs_SYSTEM " started at: %" PRIs_SYSTEM "\n", process_status->status_process_string, time_string ); } @@ -323,7 +323,7 @@ int process_status_start( { fprintf( process_status->output_stream, - "%" PRIs_LIBCSTRING_SYSTEM " started.\n", + "%" PRIs_SYSTEM " started.\n", process_status->status_process_string ); } fprintf( @@ -438,7 +438,7 @@ int process_status_update( fprintf( process_status->output_stream, - " %" PRIs_LIBCSTRING_SYSTEM "", + " %" PRIs_SYSTEM "", process_status->status_update_string ); process_status_bytes_fprint( @@ -578,7 +578,7 @@ int process_status_update_unknown_total( fprintf( process_status->output_stream, - "Status: %" PRIs_LIBCSTRING_SYSTEM "", + "Status: %" PRIs_SYSTEM "", process_status->status_update_string ); process_status_bytes_fprint( @@ -619,10 +619,10 @@ int process_status_stop( int status, libcerror_error_t **error ) { - libcstring_system_character_t time_string[ 32 ]; + system_character_t time_string[ 32 ]; static char *function = "process_status_start"; - const libcstring_system_character_t *status_string = NULL; + const system_character_t *status_string = NULL; int64_t total_number_of_seconds = 0; if( process_status == NULL ) @@ -668,19 +668,19 @@ int process_status_stop( { if( status == PROCESS_STATUS_ABORTED ) { - status_string = _LIBCSTRING_SYSTEM_STRING( "aborted" ); + status_string = _SYSTEM_STRING( "aborted" ); } else if( status == PROCESS_STATUS_COMPLETED ) { - status_string = _LIBCSTRING_SYSTEM_STRING( "completed" ); + status_string = _SYSTEM_STRING( "completed" ); } else if( status == PROCESS_STATUS_FAILED ) { - status_string = _LIBCSTRING_SYSTEM_STRING( "failed" ); + status_string = _SYSTEM_STRING( "failed" ); } fprintf( process_status->output_stream, - "%" PRIs_LIBCSTRING_SYSTEM " %" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM " %" PRIs_SYSTEM "", process_status->status_process_string, status_string ); @@ -693,7 +693,7 @@ int process_status_stop( { fprintf( process_status->output_stream, - " at: %" PRIs_LIBCSTRING_SYSTEM "\n", + " at: %" PRIs_SYSTEM "\n", time_string ); } else @@ -727,7 +727,7 @@ int process_status_stop( } fprintf( process_status->output_stream, - "%" PRIs_LIBCSTRING_SYSTEM ":", + "%" PRIs_SYSTEM ":", process_status->status_summary_string ); process_status_bytes_fprint( @@ -853,7 +853,7 @@ void process_status_bytes_per_second_fprint( size64_t bytes, time_t seconds ) { - libcstring_system_character_t bytes_per_second_string[ 16 ]; + system_character_t bytes_per_second_string[ 16 ]; size64_t bytes_per_second = 0; int result = 0; @@ -887,7 +887,7 @@ void process_status_bytes_per_second_fprint( { fprintf( stream, - " %" PRIs_LIBCSTRING_SYSTEM "/s (%" PRIu64 " bytes/second)", + " %" PRIs_SYSTEM "/s (%" PRIu64 " bytes/second)", bytes_per_second_string, bytes_per_second ); } @@ -908,7 +908,7 @@ void process_status_bytes_fprint( FILE *stream, size64_t bytes ) { - libcstring_system_character_t bytes_string[ 16 ]; + system_character_t bytes_string[ 16 ]; int result = 0; @@ -929,7 +929,7 @@ void process_status_bytes_fprint( { fprintf( stream, - " %" PRIs_LIBCSTRING_SYSTEM " (%" PRIi64 " bytes)", + " %" PRIs_SYSTEM " (%" PRIi64 " bytes)", bytes_string, bytes ); } diff --git a/ewftools/process_status.h b/ewftools/process_status.h index 059983f..b8c542b 100644 --- a/ewftools/process_status.h +++ b/ewftools/process_status.h @@ -27,7 +27,6 @@ #include "ewftools_libcdatetime.h" #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #if defined( __cplusplus ) extern "C" { @@ -46,15 +45,15 @@ struct process_status { /* The status process string */ - const libcstring_system_character_t *status_process_string; + const system_character_t *status_process_string; /* The status update string */ - const libcstring_system_character_t *status_update_string; + const system_character_t *status_update_string; /* The status summary string */ - const libcstring_system_character_t *status_summary_string; + const system_character_t *status_summary_string; /* The ouput stream */ @@ -87,9 +86,9 @@ struct process_status int process_status_initialize( process_status_t **process_status, - const libcstring_system_character_t *status_process_string, - const libcstring_system_character_t *status_update_string, - const libcstring_system_character_t *status_summary_string, + const system_character_t *status_process_string, + const system_character_t *status_update_string, + const system_character_t *status_summary_string, FILE *output_stream, uint8_t print_status_information, libcerror_error_t **error ); diff --git a/ewftools/verification_handle.c b/ewftools/verification_handle.c index 095ba7d..d16385a 100644 --- a/ewftools/verification_handle.c +++ b/ewftools/verification_handle.c @@ -21,7 +21,10 @@ #include #include +#include +#include #include +#include #include "byte_size_string.h" #include "digest_hash.h" @@ -30,7 +33,6 @@ #include "ewftools_libcerror.h" #include "ewftools_libcpath.h" #include "ewftools_libcsplit.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "log_handle.h" @@ -141,7 +143,7 @@ int verification_handle_initialize( #endif if( calculate_md5 != 0 ) { - ( *verification_handle )->calculated_md5_hash_string = libcstring_system_string_allocate( + ( *verification_handle )->calculated_md5_hash_string = system_string_allocate( 33 ); if( ( *verification_handle )->calculated_md5_hash_string == NULL ) @@ -156,7 +158,7 @@ int verification_handle_initialize( goto on_error; } } - ( *verification_handle )->stored_md5_hash_string = libcstring_system_string_allocate( + ( *verification_handle )->stored_md5_hash_string = system_string_allocate( 33 ); if( ( *verification_handle )->stored_md5_hash_string == NULL ) @@ -170,7 +172,7 @@ int verification_handle_initialize( goto on_error; } - ( *verification_handle )->stored_sha1_hash_string = libcstring_system_string_allocate( + ( *verification_handle )->stored_sha1_hash_string = system_string_allocate( 41 ); if( ( *verification_handle )->stored_sha1_hash_string == NULL ) @@ -184,7 +186,7 @@ int verification_handle_initialize( goto on_error; } - ( *verification_handle )->stored_sha256_hash_string = libcstring_system_string_allocate( + ( *verification_handle )->stored_sha256_hash_string = system_string_allocate( 65 ); if( ( *verification_handle )->stored_sha256_hash_string == NULL ) @@ -451,11 +453,11 @@ int verification_handle_set_maximum_number_of_open_handles( */ int verification_handle_open_input( verification_handle_t *verification_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ) { - libcstring_system_character_t **libewf_filenames = NULL; + system_character_t **libewf_filenames = NULL; static char *function = "verification_handle_open_input"; size_t first_filename_length = 0; @@ -494,10 +496,10 @@ int verification_handle_open_input( } if( number_of_filenames == 1 ) { - first_filename_length = libcstring_system_string_length( + first_filename_length = system_string_length( filenames[ 0 ] ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( filenames[ 0 ], first_filename_length, @@ -524,7 +526,7 @@ int verification_handle_open_input( goto on_error; } - filenames = (libcstring_system_character_t * const *) libewf_filenames; + filenames = (system_character_t * const *) libewf_filenames; } if( verification_handle->header_codepage != LIBEWF_CODEPAGE_ASCII ) { @@ -543,7 +545,7 @@ int verification_handle_open_input( goto on_error; } } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( verification_handle->input_handle, filenames, @@ -570,7 +572,7 @@ int verification_handle_open_input( } if( libewf_filenames != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -626,7 +628,7 @@ int verification_handle_open_input( on_error: if( libewf_filenames != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libewf_glob_wide_free( libewf_filenames, number_of_filenames, @@ -1404,9 +1406,9 @@ int verification_handle_verify_input( } if( process_status_initialize( &process_status, - _LIBCSTRING_SYSTEM_STRING( "Verify" ), - _LIBCSTRING_SYSTEM_STRING( "verified" ), - _LIBCSTRING_SYSTEM_STRING( "Read" ), + _SYSTEM_STRING( "Verify" ), + _SYSTEM_STRING( "verified" ), + _SYSTEM_STRING( "Read" ), verification_handle->notify_stream, print_status_information, error ) != 1 ) @@ -1758,7 +1760,7 @@ int verification_handle_verify_input( if( ( verification_handle->calculate_md5 != 0 ) && ( verification_handle->stored_md5_hash_available != 0 ) ) { - md5_hash_compare = libcstring_system_string_compare( + md5_hash_compare = system_string_compare( verification_handle->stored_md5_hash_string, verification_handle->calculated_md5_hash_string, 33 ); @@ -1766,7 +1768,7 @@ int verification_handle_verify_input( if( ( verification_handle->calculate_sha1 != 0 ) && ( verification_handle->stored_sha1_hash_available != 0 ) ) { - sha1_hash_compare = libcstring_system_string_compare( + sha1_hash_compare = system_string_compare( verification_handle->stored_sha1_hash_string, verification_handle->calculated_sha1_hash_string, 41 ); @@ -1774,7 +1776,7 @@ int verification_handle_verify_input( if( ( verification_handle->calculate_sha256 != 0 ) && ( verification_handle->stored_sha256_hash_available != 0 ) ) { - sha256_hash_compare = libcstring_system_string_compare( + sha256_hash_compare = system_string_compare( verification_handle->stored_sha256_hash_string, verification_handle->calculated_sha256_hash_string, 65 ); @@ -1854,9 +1856,9 @@ int verification_handle_verify_single_files( } if( process_status_initialize( &process_status, - _LIBCSTRING_SYSTEM_STRING( "Verify" ), - _LIBCSTRING_SYSTEM_STRING( "verified" ), - _LIBCSTRING_SYSTEM_STRING( "Read" ), + _SYSTEM_STRING( "Verify" ), + _SYSTEM_STRING( "verified" ), + _SYSTEM_STRING( "Read" ), verification_handle->notify_stream, print_status_information, error ) != 1 ) @@ -1886,7 +1888,7 @@ int verification_handle_verify_single_files( result = verification_handle_verify_file_entry( verification_handle, file_entry, - _LIBCSTRING_SYSTEM_STRING( "" ), + _SYSTEM_STRING( "" ), 0, log_handle, error ); @@ -1991,13 +1993,13 @@ int verification_handle_verify_single_files( int verification_handle_verify_file_entry( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *file_entry_path, + const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ) { - libcstring_system_character_t *name = NULL; - libcstring_system_character_t *target_path = NULL; + system_character_t *name = NULL; + system_character_t *target_path = NULL; uint8_t *file_entry_data = NULL; static char *function = "verification_handle_verify_file_entry"; size64_t file_entry_data_size = 0; @@ -2057,7 +2059,7 @@ int verification_handle_verify_file_entry( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name_size( file_entry, &name_size, @@ -2081,7 +2083,7 @@ int verification_handle_verify_file_entry( } if( name_size > 0 ) { - name = libcstring_system_string_allocate( + name = system_string_allocate( name_size ); if( name == NULL ) @@ -2095,7 +2097,7 @@ int verification_handle_verify_file_entry( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_name( file_entry, (uint16_t *) name, @@ -2122,7 +2124,7 @@ int verification_handle_verify_file_entry( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcpath_path_join_wide( &target_path, &target_path_size, @@ -2159,7 +2161,7 @@ int verification_handle_verify_file_entry( } else { - target_path = (libcstring_system_character_t *) file_entry_path; + target_path = (system_character_t *) file_entry_path; target_path_size = file_entry_path_length + 1; } if( libewf_file_entry_get_type( @@ -2182,14 +2184,14 @@ int verification_handle_verify_file_entry( { fprintf( verification_handle->notify_stream, - "Single file: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Single file: %" PRIs_SYSTEM "\n", target_path ); if( log_handle != NULL ) { log_handle_printf( log_handle, - "Single file: %" PRIs_LIBCSTRING_SYSTEM "\n", + "Single file: %" PRIs_SYSTEM "\n", target_path ); } if( libewf_file_entry_get_size( @@ -2382,7 +2384,7 @@ int verification_handle_verify_file_entry( if( ( verification_handle->calculate_md5 != 0 ) && ( verification_handle->stored_md5_hash_available != 0 ) ) { - md5_hash_compare = libcstring_system_string_compare( + md5_hash_compare = system_string_compare( verification_handle->stored_md5_hash_string, verification_handle->calculated_md5_hash_string, 33 ); @@ -2390,7 +2392,7 @@ int verification_handle_verify_file_entry( if( ( verification_handle->calculate_sha1 != 0 ) && ( verification_handle->stored_sha1_hash_available != 0 ) ) { - sha1_hash_compare = libcstring_system_string_compare( + sha1_hash_compare = system_string_compare( verification_handle->stored_sha1_hash_string, verification_handle->calculated_sha1_hash_string, 41 ); @@ -2398,7 +2400,7 @@ int verification_handle_verify_file_entry( if( ( verification_handle->calculate_sha256 != 0 ) && ( verification_handle->stored_sha256_hash_available != 0 ) ) { - sha256_hash_compare = libcstring_system_string_compare( + sha256_hash_compare = system_string_compare( verification_handle->stored_sha256_hash_string, verification_handle->calculated_sha256_hash_string, 65 ); @@ -2479,7 +2481,7 @@ int verification_handle_verify_file_entry( int verification_handle_verify_sub_file_entries( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *file_entry_path, + const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ) @@ -2681,7 +2683,7 @@ int verification_handle_get_integrity_hash_from_input( return( -1 ); } #else -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) "MD5", @@ -2711,7 +2713,7 @@ int verification_handle_get_integrity_hash_from_input( } verification_handle->stored_md5_hash_available = result; #endif -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) "SHA1", @@ -2741,7 +2743,7 @@ int verification_handle_get_integrity_hash_from_input( } verification_handle->stored_sha1_hash_available = result; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) "SHA256", @@ -2807,7 +2809,7 @@ int verification_handle_get_integrity_hash_from_file_entry( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libewf_file_entry_get_utf16_hash_value_md5( file_entry, (uint16_t *) verification_handle->stored_md5_hash_string, @@ -2845,7 +2847,7 @@ int verification_handle_get_integrity_hash_from_file_entry( */ int verification_handle_set_header_codepage( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "verification_handle_set_header_codepage"; @@ -2906,7 +2908,7 @@ int verification_handle_set_header_codepage( */ int verification_handle_set_format( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "verification_handle_set_format"; @@ -2924,14 +2926,14 @@ int verification_handle_set_format( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); if( string_length == 3 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "raw" ), + _SYSTEM_STRING( "raw" ), 3 ) == 0 ) { verification_handle->input_format = VERIFICATION_HANDLE_INPUT_FORMAT_RAW; @@ -2940,9 +2942,9 @@ int verification_handle_set_format( } else if( string_length == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string, - _LIBCSTRING_SYSTEM_STRING( "files" ), + _SYSTEM_STRING( "files" ), 5 ) == 0 ) { verification_handle->input_format = VERIFICATION_HANDLE_INPUT_FORMAT_FILES; @@ -2957,7 +2959,7 @@ int verification_handle_set_format( */ int verification_handle_set_process_buffer_size( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { static char *function = "verification_handle_set_process_buffer_size"; @@ -2976,7 +2978,7 @@ int verification_handle_set_process_buffer_size( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); result = byte_size_string_convert( @@ -3015,10 +3017,10 @@ int verification_handle_set_process_buffer_size( */ int verification_handle_set_additional_digest_types( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ) { - libcstring_system_character_t *string_segment = NULL; + system_character_t *string_segment = NULL; static char *function = "verification_handle_set_additional_digest_types"; size_t string_length = 0; size_t string_segment_size = 0; @@ -3028,7 +3030,7 @@ int verification_handle_set_additional_digest_types( int result = 0; int segment_index = 0; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_t *string_elements = NULL; #else libcsplit_narrow_split_string_t *string_elements = NULL; @@ -3045,10 +3047,10 @@ int verification_handle_set_additional_digest_types( return( -1 ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( string ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_string_split( string, string_length + 1, @@ -3073,7 +3075,7 @@ int verification_handle_set_additional_digest_types( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_number_of_segments( string_elements, &number_of_segments, @@ -3098,7 +3100,7 @@ int verification_handle_set_additional_digest_types( segment_index < number_of_segments; segment_index++ ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_get_segment_by_index( string_elements, segment_index, @@ -3138,16 +3140,16 @@ int verification_handle_set_additional_digest_types( } if( string_segment_size == 5 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha1" ), + _SYSTEM_STRING( "sha1" ), 4 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA1" ), + _SYSTEM_STRING( "SHA1" ), 4 ) == 0 ) { calculate_sha1 = 1; @@ -3155,30 +3157,30 @@ int verification_handle_set_additional_digest_types( } else if( string_segment_size == 6 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha-1" ), + _SYSTEM_STRING( "sha-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha_1" ), + _SYSTEM_STRING( "sha_1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA-1" ), + _SYSTEM_STRING( "SHA-1" ), 5 ) == 0 ) { calculate_sha1 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA_1" ), + _SYSTEM_STRING( "SHA_1" ), 5 ) == 0 ) { calculate_sha1 = 1; @@ -3186,16 +3188,16 @@ int verification_handle_set_additional_digest_types( } else if( string_segment_size == 7 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha256" ), + _SYSTEM_STRING( "sha256" ), 6 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA256" ), + _SYSTEM_STRING( "SHA256" ), 6 ) == 0 ) { calculate_sha256 = 1; @@ -3203,30 +3205,30 @@ int verification_handle_set_additional_digest_types( } else if( string_segment_size == 8 ) { - if( libcstring_system_string_compare( + if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha-256" ), + _SYSTEM_STRING( "sha-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "sha_256" ), + _SYSTEM_STRING( "sha_256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA-256" ), + _SYSTEM_STRING( "SHA-256" ), 7 ) == 0 ) { calculate_sha256 = 1; } - else if( libcstring_system_string_compare( + else if( system_string_compare( string_segment, - _LIBCSTRING_SYSTEM_STRING( "SHA_256" ), + _SYSTEM_STRING( "SHA_256" ), 7 ) == 0 ) { calculate_sha256 = 1; @@ -3236,7 +3238,7 @@ int verification_handle_set_additional_digest_types( if( ( calculate_sha1 != 0 ) && ( verification_handle->calculate_sha1 == 0 ) ) { - verification_handle->calculated_sha1_hash_string = libcstring_system_string_allocate( + verification_handle->calculated_sha1_hash_string = system_string_allocate( 41 ); if( verification_handle->calculated_sha1_hash_string == NULL ) @@ -3255,7 +3257,7 @@ int verification_handle_set_additional_digest_types( if( ( calculate_sha256 != 0 ) && ( verification_handle->calculate_sha256 == 0 ) ) { - verification_handle->calculated_sha256_hash_string = libcstring_system_string_allocate( + verification_handle->calculated_sha256_hash_string = system_string_allocate( 65 ); if( verification_handle->calculated_sha256_hash_string == NULL ) @@ -3271,7 +3273,7 @@ int verification_handle_set_additional_digest_types( } verification_handle->calculate_sha256 = 1; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libcsplit_wide_split_string_free( &string_elements, error ) != 1 ) @@ -3295,7 +3297,7 @@ int verification_handle_set_additional_digest_types( on_error: if( string_elements != NULL ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) libcsplit_wide_split_string_free( &string_elements, NULL ); @@ -3452,12 +3454,12 @@ int verification_handle_hash_values_fprint( { fprintf( stream, - "MD5 hash stored in file:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "MD5 hash stored in file:\t\t%" PRIs_SYSTEM "\n", verification_handle->stored_md5_hash_string ); } fprintf( stream, - "MD5 hash calculated over data:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "MD5 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", verification_handle->calculated_md5_hash_string ); } if( verification_handle->calculate_sha1 != 0 ) @@ -3472,12 +3474,12 @@ int verification_handle_hash_values_fprint( { fprintf( stream, - "SHA1 hash stored in file:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA1 hash stored in file:\t\t%" PRIs_SYSTEM "\n", verification_handle->stored_sha1_hash_string ); } fprintf( stream, - "SHA1 hash calculated over data:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA1 hash calculated over data:\t\t%" PRIs_SYSTEM "\n", verification_handle->calculated_sha1_hash_string ); } if( verification_handle->calculate_sha256 != 0 ) @@ -3492,12 +3494,12 @@ int verification_handle_hash_values_fprint( { fprintf( stream, - "SHA256 hash stored in file:\t\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA256 hash stored in file:\t\t%" PRIs_SYSTEM "\n", verification_handle->stored_sha256_hash_string ); } fprintf( stream, - "SHA256 hash calculated over data:\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "SHA256 hash calculated over data:\t%" PRIs_SYSTEM "\n", verification_handle->calculated_sha256_hash_string ); } return( 1 ); @@ -3512,7 +3514,7 @@ int verification_handle_additional_hash_values_fprint( libcerror_error_t **error ) { char hash_value_identifier[ VERIFICATION_HANDLE_VALUE_IDENTIFIER_SIZE ]; - libcstring_system_character_t hash_value[ VERIFICATION_HANDLE_VALUE_SIZE ]; + system_character_t hash_value[ VERIFICATION_HANDLE_VALUE_SIZE ]; static char *function = "verification_handle_additional_hash_values_fprint"; size_t hash_value_identifier_size = VERIFICATION_HANDLE_VALUE_IDENTIFIER_SIZE; @@ -3617,7 +3619,7 @@ int verification_handle_additional_hash_values_fprint( { if( hash_value_identifier_size == 4 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( hash_value_identifier, "MD5", 3 ) == 0 ) @@ -3630,7 +3632,7 @@ int verification_handle_additional_hash_values_fprint( { if( hash_value_identifier_size == 5 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( hash_value_identifier, "SHA1", 4 ) == 0 ) @@ -3643,7 +3645,7 @@ int verification_handle_additional_hash_values_fprint( { if( hash_value_identifier_size == 7 ) { - if( libcstring_narrow_string_compare( + if( narrow_string_compare( hash_value_identifier, "SHA256", 6 ) == 0 ) @@ -3652,7 +3654,7 @@ int verification_handle_additional_hash_values_fprint( } } } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_get_utf16_hash_value( verification_handle->input_handle, (uint8_t *) hash_value_identifier, @@ -3692,7 +3694,7 @@ int verification_handle_additional_hash_values_fprint( } fprintf( stream, - "%s:\t%" PRIs_LIBCSTRING_SYSTEM "\n", + "%s:\t%" PRIs_SYSTEM "\n", hash_value_identifier, hash_value ); } @@ -3708,8 +3710,8 @@ int verification_handle_checksum_errors_fprint( FILE *stream, libcerror_error_t **error ) { - libcstring_system_character_t *filename = NULL; - libcstring_system_character_t *last_filename = NULL; + system_character_t *filename = NULL; + system_character_t *last_filename = NULL; static char *function = "verification_handle_checksum_errors_fprint"; size_t filename_size = 0; size_t last_filename_size = 0; @@ -3827,7 +3829,7 @@ int verification_handle_checksum_errors_fprint( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result= libewf_handle_get_filename_size_wide( verification_handle->input_handle, &filename_size, @@ -3851,7 +3853,7 @@ int verification_handle_checksum_errors_fprint( } else if( result != 0 ) { - filename = libcstring_system_string_allocate( + filename = system_string_allocate( filename_size ); if( filename == NULL ) @@ -3865,7 +3867,7 @@ int verification_handle_checksum_errors_fprint( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_get_filename_wide( verification_handle->input_handle, filename, @@ -3892,7 +3894,7 @@ int verification_handle_checksum_errors_fprint( { fprintf( stream, - " %" PRIs_LIBCSTRING_SYSTEM "", + " %" PRIs_SYSTEM "", filename ); last_filename = filename; @@ -3906,7 +3908,7 @@ int verification_handle_checksum_errors_fprint( { fprintf( stream, - ", %" PRIs_LIBCSTRING_SYSTEM "", + ", %" PRIs_SYSTEM "", filename ); memory_free( diff --git a/ewftools/verification_handle.h b/ewftools/verification_handle.h index 11658cb..66db8a9 100644 --- a/ewftools/verification_handle.h +++ b/ewftools/verification_handle.h @@ -27,7 +27,6 @@ #include "digest_hash.h" #include "ewftools_libcerror.h" -#include "ewftools_libcstring.h" #include "ewftools_libewf.h" #include "ewftools_libhmac.h" #include "log_handle.h" @@ -73,7 +72,7 @@ struct verification_handle /* The calculated MD5 digest hash string */ - libcstring_system_character_t *calculated_md5_hash_string; + system_character_t *calculated_md5_hash_string; /* Value to indicate a stored MD5 digest hash is available */ @@ -81,7 +80,7 @@ struct verification_handle /* The stored MD5 digest hash string */ - libcstring_system_character_t *stored_md5_hash_string; + system_character_t *stored_md5_hash_string; /* Value to indicate if the SHA1 digest hash should be calculated */ @@ -97,7 +96,7 @@ struct verification_handle /* The calculated SHA1 digest hash string */ - libcstring_system_character_t *calculated_sha1_hash_string; + system_character_t *calculated_sha1_hash_string; /* Value to indicate a stored SHA1 digest hash is available */ @@ -105,7 +104,7 @@ struct verification_handle /* The stored SHA1 digest hash string */ - libcstring_system_character_t *stored_sha1_hash_string; + system_character_t *stored_sha1_hash_string; /* Value to indicate if the SHA256 digest hash should be calculated */ @@ -121,7 +120,7 @@ struct verification_handle /* The calculated SHA256 digest hash string */ - libcstring_system_character_t *calculated_sha256_hash_string; + system_character_t *calculated_sha256_hash_string; /* Value to indicate a stored SHA256 digest hash is available */ @@ -129,7 +128,7 @@ struct verification_handle /* The stored SHA256 digest hash string */ - libcstring_system_character_t *stored_sha256_hash_string; + system_character_t *stored_sha256_hash_string; /* Value to indicate if the chunk data instead of the buffered read and write functions should be used */ @@ -185,7 +184,7 @@ int verification_handle_set_maximum_number_of_open_handles( int verification_handle_open_input( verification_handle_t *verification_handle, - libcstring_system_character_t * const * filenames, + system_character_t * const * filenames, int number_of_filenames, libcerror_error_t **error ); @@ -233,7 +232,7 @@ int verification_handle_verify_single_files( int verification_handle_verify_file_entry( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *file_entry_path, + const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ); @@ -241,7 +240,7 @@ int verification_handle_verify_file_entry( int verification_handle_verify_sub_file_entries( verification_handle_t *verification_handle, libewf_file_entry_t *file_entry, - const libcstring_system_character_t *file_entry_path, + const system_character_t *file_entry_path, size_t file_entry_path_length, log_handle_t *log_handle, libcerror_error_t **error ); @@ -257,22 +256,22 @@ int verification_handle_get_integrity_hash_from_file_entry( int verification_handle_set_header_codepage( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_format( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_process_buffer_size( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_additional_digest_types( verification_handle_t *verification_handle, - const libcstring_system_character_t *string, + const system_character_t *string, libcerror_error_t **error ); int verification_handle_set_zero_chunk_on_error( diff --git a/libewf.spec.in b/libewf.spec.in index 5ddf7de..1046ea6 100644 --- a/libewf.spec.in +++ b/libewf.spec.in @@ -7,8 +7,8 @@ License: LGPL Source: %{name}-%{version}.tar.gz URL: https://github.com/libyal/libewf-legacy BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -@libewf_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcstring_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libhmac_spec_requires@ @ax_libmfdata_spec_requires@ @ax_libuna_spec_requires@ @ax_zlib_spec_requires@ -BuildRequires: gcc @ax_libbfio_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcstring_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libhmac_spec_build_requires@ @ax_libmfdata_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@ +@libewf_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libhmac_spec_requires@ @ax_libmfdata_spec_requires@ @ax_libuna_spec_requires@ @ax_zlib_spec_requires@ +BuildRequires: gcc @ax_libbfio_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libhmac_spec_build_requires@ @ax_libmfdata_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@ %description libewf is a library to access the Expert Witness Compression Format (EWF). @@ -19,8 +19,8 @@ Supports files created by EnCase 1 to 7, linen 5 to 7 and FTK Imager. %package -n libewf-static Summary: Library to access the Expert Witness Compression Format (EWF) Group: Development/Libraries -@libewf_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcstring_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libhmac_spec_requires@ @ax_libmfdata_spec_requires@ @ax_libuna_spec_requires@ @ax_zlib_static_spec_requires@ -BuildRequires: gcc @ax_libbfio_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcstring_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libhmac_spec_build_requires@ @ax_libmfdata_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@ +@libewf_spec_requires@ @ax_libbfio_spec_requires@ @ax_libcdata_spec_requires@ @ax_libcerror_spec_requires@ @ax_libcfile_spec_requires@ @ax_libclocale_spec_requires@ @ax_libcnotify_spec_requires@ @ax_libcpath_spec_requires@ @ax_libcrypto_spec_requires@ @ax_libcsplit_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfcache_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libhmac_spec_requires@ @ax_libmfdata_spec_requires@ @ax_libuna_spec_requires@ @ax_zlib_static_spec_requires@ +BuildRequires: gcc @ax_libbfio_spec_build_requires@ @ax_libcdata_spec_build_requires@ @ax_libcerror_spec_build_requires@ @ax_libcfile_spec_build_requires@ @ax_libclocale_spec_build_requires@ @ax_libcnotify_spec_build_requires@ @ax_libcpath_spec_build_requires@ @ax_libcrypto_spec_build_requires@ @ax_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfcache_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libhmac_spec_build_requires@ @ax_libmfdata_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@ %description -n libewf-static Static library version of libewf diff --git a/libewf/Makefile.am b/libewf/Makefile.am index 2cc7741..3609bb4 100644 --- a/libewf/Makefile.am +++ b/libewf/Makefile.am @@ -1,7 +1,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCTHREADS_CPPFLAGS@ \ @@ -65,7 +64,6 @@ libewf_la_SOURCES = \ libewf_libcerror.h \ libewf_libclocale.h \ libewf_libcnotify.h \ - libewf_libcstring.h \ libewf_libbfio.h \ libewf_libfcache.h \ libewf_libfdata.h \ @@ -90,7 +88,6 @@ libewf_la_SOURCES = \ libewf_write_io_handle.c libewf_write_io_handle.h libewf_la_LIBADD = \ - @LIBCSTRING_LIBADD@ \ @LIBCERROR_LIBADD@ \ @LIBCTHREADS_LIBADD@ \ @LIBCDATA_LIBADD@ \ diff --git a/libewf/libewf_date_time_values.c b/libewf/libewf_date_time_values.c index 6d0b174..b4e6972 100644 --- a/libewf/libewf_date_time_values.c +++ b/libewf/libewf_date_time_values.c @@ -21,6 +21,7 @@ #include #include +#include #include #if defined( TIME_WITH_SYS_TIME ) @@ -36,7 +37,6 @@ #include "libewf_date_time_values.h" #include "libewf_definitions.h" #include "libewf_libcerror.h" -#include "libewf_libcstring.h" #include "libewf_libfvalue.h" /* Copies date and time values string from a timestamp @@ -888,49 +888,49 @@ int libewf_utf8_string_day_of_week_copy_to_time_elements( return( -1 ); } - if( libcstring_narrow_string_compare( + if( narrow_string_compare( utf8_string, "Sun", 3 ) == 0 ) { time_elements->tm_wday = 0; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Mon", 3 ) == 0 ) { time_elements->tm_wday = 1; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Tue", 3 ) == 0 ) { time_elements->tm_wday = 2; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Wed", 3 ) == 0 ) { time_elements->tm_wday = 3; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Thu", 3 ) == 0 ) { time_elements->tm_wday = 4; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Fri", 3 ) == 0 ) { time_elements->tm_wday = 5; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Sat", 3 ) == 0 ) @@ -1286,84 +1286,84 @@ int libewf_utf8_string_month_copy_to_time_elements( return( -1 ); } - if( libcstring_narrow_string_compare( + if( narrow_string_compare( utf8_string, "Jan", 3 ) == 0 ) { time_elements->tm_mon = 0; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Feb", 3 ) == 0 ) { time_elements->tm_mon = 1; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Mar", 3 ) == 0 ) { time_elements->tm_mon = 2; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Apr", 3 ) == 0 ) { time_elements->tm_mon = 3; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "May", 3 ) == 0 ) { time_elements->tm_mon = 4; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Jun", 3 ) == 0 ) { time_elements->tm_mon = 5; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Jul", 3 ) == 0 ) { time_elements->tm_mon = 6; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Aug", 3 ) == 0 ) { time_elements->tm_mon = 7; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Sep", 3 ) == 0 ) { time_elements->tm_mon = 8; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Oct", 3 ) == 0 ) { time_elements->tm_mon = 9; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Nov", 3 ) == 0 ) { time_elements->tm_mon = 10; } - else if( libcstring_narrow_string_compare( + else if( narrow_string_compare( utf8_string, "Dec", 3 ) == 0 ) diff --git a/libewf/libewf_debug.c b/libewf/libewf_debug.c index 16b596b..b4fddee 100644 --- a/libewf/libewf_debug.c +++ b/libewf/libewf_debug.c @@ -22,13 +22,15 @@ #include #include #include +#include +#include #include +#include #include "libewf_checksum.h" #include "libewf_debug.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" #include "libewf_libuna.h" /* Prints a dump of data @@ -124,10 +126,10 @@ int libewf_debug_byte_stream_print( size_t byte_stream_size, libcerror_error_t **error ) { - libcstring_system_character_t *string = NULL; - static char *function = "libewf_debug_byte_stream_print"; - size_t string_size = 0; - int result = 0; + system_character_t *string = NULL; + static char *function = "libewf_debug_byte_stream_print"; + size_t string_size = 0; + int result = 0; if( header_string == NULL ) { @@ -151,7 +153,7 @@ int libewf_debug_byte_stream_print( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_size_from_byte_stream( byte_stream, byte_stream_size, @@ -177,7 +179,7 @@ int libewf_debug_byte_stream_print( return( -1 ); } - string = libcstring_system_string_allocate( + string = system_string_allocate( string_size ); if( string == NULL ) @@ -191,7 +193,7 @@ int libewf_debug_byte_stream_print( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_copy_from_byte_stream( (uint16_t *) string, string_size, @@ -224,7 +226,7 @@ int libewf_debug_byte_stream_print( } libcnotify_printf( "%s:\n" - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", header_string, string ); @@ -243,10 +245,10 @@ int libewf_debug_utf8_stream_print( size_t utf8_stream_size, libcerror_error_t **error ) { - libcstring_system_character_t *string = NULL; - static char *function = "libewf_debug_utf8_stream_print"; - size_t string_size = 0; - int result = 0; + system_character_t *string = NULL; + static char *function = "libewf_debug_utf8_stream_print"; + size_t string_size = 0; + int result = 0; if( header_string == NULL ) { @@ -270,7 +272,7 @@ int libewf_debug_utf8_stream_print( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_size_from_utf8_stream( utf8_stream, utf8_stream_size, @@ -294,7 +296,7 @@ int libewf_debug_utf8_stream_print( return( -1 ); } - string = libcstring_system_string_allocate( + string = system_string_allocate( string_size ); if( string == NULL ) @@ -308,7 +310,7 @@ int libewf_debug_utf8_stream_print( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_copy_from_utf8_stream( (uint16_t *) string, string_size, @@ -339,7 +341,7 @@ int libewf_debug_utf8_stream_print( } libcnotify_printf( "%s:\n" - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", header_string, string ); @@ -358,10 +360,10 @@ int libewf_debug_utf16_stream_print( size_t utf16_stream_size, libcerror_error_t **error ) { - libcstring_system_character_t *string = NULL; - static char *function = "libewf_debug_utf16_stream_print"; - size_t string_size = 0; - int result = 0; + system_character_t *string = NULL; + static char *function = "libewf_debug_utf16_stream_print"; + size_t string_size = 0; + int result = 0; if( header_string == NULL ) { @@ -385,7 +387,7 @@ int libewf_debug_utf16_stream_print( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_size_from_utf16_stream( utf16_stream, utf16_stream_size, @@ -411,7 +413,7 @@ int libewf_debug_utf16_stream_print( return( -1 ); } - string = libcstring_system_string_allocate( + string = system_string_allocate( string_size ); if( string == NULL ) @@ -425,7 +427,7 @@ int libewf_debug_utf16_stream_print( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) result = libuna_utf16_string_copy_from_utf16_stream( (uint16_t *) string, string_size, @@ -458,7 +460,7 @@ int libewf_debug_utf16_stream_print( } libcnotify_printf( "%s:\n" - "%" PRIs_LIBCSTRING_SYSTEM "", + "%" PRIs_SYSTEM "", header_string, string ); diff --git a/libewf/libewf_file_entry.c b/libewf/libewf_file_entry.c index 7808d0d..b72e0a1 100644 --- a/libewf/libewf_file_entry.c +++ b/libewf/libewf_file_entry.c @@ -30,7 +30,6 @@ #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" #include "libewf_single_file_entry.h" #include "libewf_single_file_tree.h" #include "libewf_types.h" diff --git a/libewf/libewf_filename.c b/libewf/libewf_filename.c index c06d69d..b3f4bf1 100644 --- a/libewf/libewf_filename.c +++ b/libewf/libewf_filename.c @@ -21,13 +21,14 @@ #include #include +#include +#include #include - -#include "libewf_libcstring.h" -#include "libewf_libcerror.h" +#include #include "libewf_definitions.h" #include "libewf_filename.h" +#include "libewf_libcerror.h" #include "ewf_definitions.h" @@ -297,9 +298,9 @@ int libewf_filename_set_extension_wide( * Returns 1 if successful or -1 on error */ int libewf_filename_create( - libcstring_system_character_t **filename, + system_character_t **filename, size_t *filename_size, - libcstring_system_character_t *basename, + system_character_t *basename, size_t basename_length, uint16_t segment_number, uint16_t maximum_number_of_segments, @@ -308,8 +309,8 @@ int libewf_filename_create( uint8_t ewf_format, libcerror_error_t **error ) { - libcstring_system_character_t *new_filename = NULL; - static char *function = "libewf_filename_create"; + system_character_t *new_filename = NULL; + static char *function = "libewf_filename_create"; if( filename == NULL ) { @@ -357,7 +358,7 @@ int libewf_filename_create( } /* The actual filename also contains a '.', 3 character extension and a end of string byte */ - new_filename = libcstring_system_string_allocate( + new_filename = system_string_allocate( basename_length + 5 ); if( new_filename == NULL ) @@ -373,7 +374,7 @@ int libewf_filename_create( } /* Add one additional character for the end of line */ - if( libcstring_system_string_copy( + if( system_string_copy( new_filename, basename, ( basename_length + 1 ) ) == NULL ) @@ -390,9 +391,9 @@ int libewf_filename_create( return( -1 ); } - new_filename[ basename_length ] = (libcstring_system_character_t) '.'; + new_filename[ basename_length ] = (system_character_t) '.'; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_filename_set_extension_wide( &( new_filename[ basename_length + 1 ] ), segment_number, diff --git a/libewf/libewf_filename.h b/libewf/libewf_filename.h index e4595f6..4a99772 100644 --- a/libewf/libewf_filename.h +++ b/libewf/libewf_filename.h @@ -26,7 +26,6 @@ #include #include -#include "libewf_libcstring.h" #include "libewf_libcerror.h" #if defined( __cplusplus ) @@ -43,6 +42,7 @@ int libewf_filename_set_extension( libcerror_error_t **error ); #if defined( HAVE_WIDE_CHARACTER_TYPE ) + int libewf_filename_set_extension_wide( wchar_t *extension, uint16_t segment_number, @@ -51,12 +51,13 @@ int libewf_filename_set_extension_wide( uint8_t format, uint8_t ewf_format, libcerror_error_t **error ); -#endif + +#endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ int libewf_filename_create( - libcstring_system_character_t **filename, + system_character_t **filename, size_t *filename_size, - libcstring_system_character_t *basename, + system_character_t *basename, size_t basename_length, uint16_t segment_number, uint16_t maximum_number_of_segments, @@ -69,5 +70,5 @@ int libewf_filename_create( } #endif -#endif +#endif /* !defined( _LIBEWF_FILENAME_H ) */ diff --git a/libewf/libewf_handle.c b/libewf/libewf_handle.c index 58ef4b3..56ace04 100644 --- a/libewf/libewf_handle.c +++ b/libewf/libewf_handle.c @@ -21,7 +21,9 @@ #include #include +#include #include +#include #if defined( TIME_WITH_SYS_TIME ) #include @@ -46,16 +48,15 @@ #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" -#include "libewf_libfvalue.h" #include "libewf_libfcache.h" +#include "libewf_libfvalue.h" #include "libewf_libmfdata.h" #include "libewf_metadata.h" #include "libewf_sector_range.h" #include "libewf_segment_file.h" #include "libewf_single_file_entry.h" -#include "libewf_single_file_tree.h" #include "libewf_single_files.h" +#include "libewf_single_file_tree.h" #include "libewf_types.h" #include "libewf_unused.h" #include "libewf_write_io_handle.h" @@ -1035,7 +1036,7 @@ int libewf_handle_open( filename_iterator < number_of_filenames; filename_iterator++ ) { - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( filenames[ filename_iterator ] ); /* Make sure there is more to the filename than the extension @@ -1187,7 +1188,7 @@ int libewf_handle_open( */ if( first_segment_filename != NULL ) { - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( first_segment_filename ); /* Set segment table basename @@ -1212,7 +1213,7 @@ int libewf_handle_open( */ if( first_delta_segment_filename != NULL ) { - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( first_delta_segment_filename ); /* Set delta segment table basename @@ -1240,7 +1241,7 @@ int libewf_handle_open( */ if( first_segment_filename != NULL ) { - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( first_segment_filename ); /* Set segment table basename @@ -1266,7 +1267,7 @@ int libewf_handle_open( { /* Get the basename and store it in the segment tables */ - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( filenames[ 0 ] ); /* Set segment table basename @@ -1437,7 +1438,7 @@ int libewf_handle_open_wide( filename_iterator < number_of_filenames; filename_iterator++ ) { - filename_length = libcstring_wide_string_length( + filename_length = wide_string_length( filenames[ filename_iterator ] ); /* Make sure there is more to the filename than the extension @@ -1589,7 +1590,7 @@ int libewf_handle_open_wide( */ if( first_segment_filename != NULL ) { - filename_length = libcstring_wide_string_length( + filename_length = wide_string_length( first_segment_filename ); /* Set segment table basename @@ -1614,7 +1615,7 @@ int libewf_handle_open_wide( */ if( first_delta_segment_filename != NULL ) { - filename_length = libcstring_wide_string_length( + filename_length = wide_string_length( first_delta_segment_filename ); /* Set delta segment table basename @@ -1642,7 +1643,7 @@ int libewf_handle_open_wide( */ if( first_segment_filename != NULL ) { - filename_length = libcstring_wide_string_length( + filename_length = wide_string_length( first_segment_filename ); /* Set segment table basename @@ -1668,7 +1669,7 @@ int libewf_handle_open_wide( { /* Get the basename and store it in the segment tables */ - filename_length = libcstring_wide_string_length( + filename_length = wide_string_length( filenames[ 0 ] ); /* Set segment table basename diff --git a/libewf/libewf_hash_values.c b/libewf/libewf_hash_values.c index 00b8182..9b7af75 100644 --- a/libewf/libewf_hash_values.c +++ b/libewf/libewf_hash_values.c @@ -21,13 +21,13 @@ #include #include +#include #include #include "libewf_definitions.h" #include "libewf_hash_values.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" @@ -502,17 +502,17 @@ int libewf_hash_values_generate_xhash( } xml_head = "\n"; - xml_head_length = libcstring_narrow_string_length( + xml_head_length = narrow_string_length( xml_head ); xml_xhash_open_tag = "\n"; - xml_xhash_open_tag_length = libcstring_narrow_string_length( + xml_xhash_open_tag_length = narrow_string_length( xml_xhash_open_tag ); xml_xhash_close_tag = "\n\n"; - xml_xhash_close_tag_length = libcstring_narrow_string_length( + xml_xhash_close_tag_length = narrow_string_length( xml_xhash_close_tag ); /* Reserve space for the UTF-8 byte order mark and the XML skeleton data @@ -617,7 +617,7 @@ int libewf_hash_values_generate_xhash( ( *xhash )[ xhash_index++ ] = 0xbb; ( *xhash )[ xhash_index++ ] = 0xbf; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), xml_head, xml_head_length ) == NULL ) @@ -633,7 +633,7 @@ int libewf_hash_values_generate_xhash( } xhash_index += xml_head_length; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), xml_xhash_open_tag, xml_xhash_open_tag_length ) == NULL ) @@ -723,7 +723,7 @@ int libewf_hash_values_generate_xhash( ( *xhash )[ xhash_index++ ] = (uint8_t) '\t'; ( *xhash )[ xhash_index++ ] = (uint8_t) '<'; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) @@ -763,7 +763,7 @@ int libewf_hash_values_generate_xhash( ( *xhash )[ xhash_index - 1 ] = (uint8_t) '<'; ( *xhash )[ xhash_index++ ] = (uint8_t) '/'; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) @@ -784,7 +784,7 @@ int libewf_hash_values_generate_xhash( ( *xhash )[ xhash_index++ ] = (uint8_t) '\n'; } } - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xhash )[ xhash_index ] ), xml_xhash_close_tag, xml_xhash_close_tag_length ) == NULL ) diff --git a/libewf/libewf_header_values.c b/libewf/libewf_header_values.c index f449551..d5cfc00 100644 --- a/libewf/libewf_header_values.c +++ b/libewf/libewf_header_values.c @@ -21,9 +21,9 @@ #include #include +#include #include - #if defined( TIME_WITH_SYS_TIME ) #include #include @@ -39,7 +39,6 @@ #include "libewf_header_values.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" @@ -1399,7 +1398,7 @@ int libewf_header_values_copy( * They will be auto generated */ else if( ( identifier_size == 13 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) @@ -1407,7 +1406,7 @@ int libewf_header_values_copy( continue; } else if( ( identifier_size == 12 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) @@ -2088,7 +2087,7 @@ int libewf_header_values_parse_utf8_header_string( /* If the date time values string contains spaces it's in the old header * format otherwise is in new header2 format */ - else if( libcstring_narrow_string_search_character( + else if( narrow_string_search_character( (char *) value_string, ' ', value_string_size - 1 ) != NULL ) @@ -2137,7 +2136,7 @@ int libewf_header_values_parse_utf8_header_string( if( date_time_values_string != NULL ) { value_string = date_time_values_string; - value_string_size = 1 + libcstring_narrow_string_length( + value_string_size = 1 + narrow_string_length( (char *) date_time_values_string ); if( type_string[ 0 ] == (uint8_t) 'm' ) @@ -3450,7 +3449,7 @@ int libewf_header_values_generate_utf8_header_string( { /* Make sure to determine the actual length of the date time values string */ - acquiry_date_string_length = libcstring_narrow_string_length( + acquiry_date_string_length = narrow_string_length( (char *) generated_acquiry_date ); } } @@ -3528,7 +3527,7 @@ int libewf_header_values_generate_utf8_header_string( { /* Make sure to determine the actual length of the date time values string */ - system_date_string_length = libcstring_narrow_string_length( + system_date_string_length = narrow_string_length( (char *) generated_system_date ); } } @@ -3670,7 +3669,7 @@ int libewf_header_values_generate_utf8_header_string( { generated_compression_level = LIBEWF_HEADER_VALUE_COMPRESSION_LEVEL_BEST; } - compression_level_string_length = libcstring_narrow_string_length( + compression_level_string_length = narrow_string_length( generated_compression_level ); } *utf8_string_size += compression_level_string_length; @@ -3861,7 +3860,7 @@ int libewf_header_values_generate_utf8_header_string( "p\tn\tid\tev\ttb\tlo\tpo\tah\tgu\taq\n0\t0\n\t\t\t\t\t-1\t-1\t\t\t\n" "\n"; - srce_section_string_length = libcstring_narrow_string_length( + srce_section_string_length = narrow_string_length( generated_srce_section ); *utf8_string_size += srce_section_string_length; @@ -3875,7 +3874,7 @@ int libewf_header_values_generate_utf8_header_string( "\t\t\t\t\t-1\t-1\t00000000000000000000000000000000\t0000000000000000000000000000000000000000\t00000000000000000000000000000000\t\n" "\n"; - srce_section_string_length = libcstring_narrow_string_length( + srce_section_string_length = narrow_string_length( generated_srce_section ); *utf8_string_size += srce_section_string_length; @@ -3891,7 +3890,7 @@ int libewf_header_values_generate_utf8_header_string( "\t\t\t\t1\t\n" "\n"; - sub_section_string_length = libcstring_narrow_string_length( + sub_section_string_length = narrow_string_length( generated_sub_section ); *utf8_string_size += sub_section_string_length; @@ -3905,7 +3904,7 @@ int libewf_header_values_generate_utf8_header_string( "\t\t\t\t1\t00000000000000000000000000000000\n" "\n"; - sub_section_string_length = libcstring_narrow_string_length( + sub_section_string_length = narrow_string_length( generated_sub_section ); *utf8_string_size += sub_section_string_length; @@ -4395,7 +4394,7 @@ int libewf_header_values_generate_utf8_header_string( } else { - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), (char *) generated_acquiry_date, acquiry_date_string_length ) == NULL ) @@ -4445,7 +4444,7 @@ int libewf_header_values_generate_utf8_header_string( } else { - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), (char *) generated_system_date, system_date_string_length ) == NULL ) @@ -4495,7 +4494,7 @@ int libewf_header_values_generate_utf8_header_string( } else { - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_password, password_string_length ) == NULL ) @@ -4541,7 +4540,7 @@ int libewf_header_values_generate_utf8_header_string( } else { - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_compression_level, compression_level_string_length ) == NULL ) @@ -4666,7 +4665,7 @@ int libewf_header_values_generate_utf8_header_string( { if( srce_section_string_length > 0 ) { - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_srce_section, srce_section_string_length ) == NULL ) @@ -4684,7 +4683,7 @@ int libewf_header_values_generate_utf8_header_string( } if( sub_section_string_length > 0 ) { - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *utf8_string )[ utf8_string_index ] ), generated_sub_section, sub_section_string_length ) == NULL ) @@ -5814,7 +5813,7 @@ int libewf_convert_date_xheader_value( { ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *date_time_values_string )[ date_time_values_string_index ] ), (char *) timezone_string, timezone_string_size - 1 ) == NULL ) @@ -5834,7 +5833,7 @@ int libewf_convert_date_xheader_value( { ( *date_time_values_string )[ date_time_values_string_index++ ] = (uint8_t) ' '; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *date_time_values_string )[ date_time_values_string_index ] ), (char *) timezone_name, timezone_name_size - 1 ) == NULL ) @@ -6082,7 +6081,7 @@ int libewf_generate_date_xheader_value( #if defined( _BSD_SOURCE ) time_elements.tm_gmtoff /= 60; - print_count = libcstring_narrow_string_snprintf( + print_count = narrow_string_snprintf( (char *) &( ( ( *date_time_values_string )[ date_time_values_string_index ] ) ), *date_time_values_string_size - date_time_values_string_index, "%+03ld:%02ld (%s)", @@ -6093,12 +6092,12 @@ int libewf_generate_date_xheader_value( #elif defined( WINAPI ) /* WINAPI sometimes uses long timezone names */ - tzname_length = libcstring_narrow_string_length( + tzname_length = narrow_string_length( _tzname[ time_elements.tm_isdst ] ); if( tzname_length <= 4 ) { - print_count = libcstring_narrow_string_snprintf( + print_count = narrow_string_snprintf( (char *) &( ( ( *date_time_values_string )[ date_time_values_string_index ] ) ), *date_time_values_string_size - date_time_values_string_index, "%s", @@ -6109,7 +6108,7 @@ int libewf_generate_date_xheader_value( print_count = 0; } #else - print_count = libcstring_narrow_string_snprintf( + print_count = narrow_string_snprintf( (char *) &( ( ( *date_time_values_string )[ date_time_values_string_index ] ) ), *date_time_values_string_size - date_time_values_string_index, "%s", @@ -6284,7 +6283,7 @@ int libewf_header_values_parse_xheader_date_value( { /* Make sure to determine the actual length of the date time values string */ - date_time_values_string_size = 1 + libcstring_narrow_string_length( + date_time_values_string_size = 1 + narrow_string_length( (char *) date_time_values_string ); if( libfvalue_value_set_data( @@ -6410,17 +6409,17 @@ int libewf_header_values_generate_xheader( } xml_head = "\n"; - xml_head_length = libcstring_narrow_string_length( + xml_head_length = narrow_string_length( xml_head ); xml_xheader_open_tag = "\n"; - xml_xheader_open_tag_length = libcstring_narrow_string_length( + xml_xheader_open_tag_length = narrow_string_length( xml_xheader_open_tag ); xml_xheader_close_tag = "\n\n"; - xml_xheader_close_tag_length = libcstring_narrow_string_length( + xml_xheader_close_tag_length = narrow_string_length( xml_xheader_close_tag ); /* Reserve space for the UTF-8 byte order mark and the XML skeleton data @@ -6497,7 +6496,7 @@ int libewf_header_values_generate_xheader( { if( ( generated_acquiry_date == NULL ) && ( identifier_size == 13 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) @@ -6531,7 +6530,7 @@ int libewf_header_values_generate_xheader( } else { - acquiry_date_string_length = libcstring_narrow_string_length( + acquiry_date_string_length = narrow_string_length( (char *) generated_acquiry_date ); /* Reserve space for a leading tab, , header value, and a newline @@ -6589,7 +6588,7 @@ int libewf_header_values_generate_xheader( ( *xheader )[ xheader_index++ ] = 0xbb; ( *xheader )[ xheader_index++ ] = 0xbf; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), xml_head, xml_head_length ) == NULL ) @@ -6605,7 +6604,7 @@ int libewf_header_values_generate_xheader( } xheader_index += xml_head_length; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), xml_xheader_open_tag, xml_xheader_open_tag_length ) == NULL ) @@ -6714,7 +6713,7 @@ int libewf_header_values_generate_xheader( ( *xheader )[ xheader_index++ ] = (uint8_t) '\t'; ( *xheader )[ xheader_index++ ] = (uint8_t) '<'; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) @@ -6756,7 +6755,7 @@ int libewf_header_values_generate_xheader( ( *xheader )[ xheader_index - 1 ] = (uint8_t) '<'; ( *xheader )[ xheader_index++ ] = (uint8_t) '/'; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), (char *) identifier, identifier_size - 1 ) == NULL ) @@ -6779,7 +6778,7 @@ int libewf_header_values_generate_xheader( } if( generated_acquiry_date != NULL ) { - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), "\t", 15 ) == NULL ) @@ -6795,7 +6794,7 @@ int libewf_header_values_generate_xheader( } xheader_index += 15; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), (char *) generated_acquiry_date, acquiry_date_string_length ) == NULL ) @@ -6816,7 +6815,7 @@ int libewf_header_values_generate_xheader( generated_acquiry_date = NULL; - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), "\n", 16 ) == NULL ) @@ -6832,7 +6831,7 @@ int libewf_header_values_generate_xheader( } xheader_index += 16; } - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) &( ( *xheader )[ xheader_index ] ), xml_xheader_close_tag, xml_xheader_close_tag_length ) == NULL ) diff --git a/libewf/libewf_legacy.c b/libewf/libewf_legacy.c index 387f3f4..8b95448 100644 --- a/libewf/libewf_legacy.c +++ b/libewf/libewf_legacy.c @@ -21,15 +21,14 @@ #include #include +#include #include -#include "libewf_libcstring.h" -#include "libewf_libcerror.h" -#include "libewf_libcnotify.h" - #include "libewf_definitions.h" #include "libewf_file_entry.h" #include "libewf_handle.h" +#include "libewf_libcerror.h" +#include "libewf_libcnotify.h" #include "libewf_metadata.h" #include "libewf_notify.h" #include "libewf_types.h" @@ -3499,7 +3498,7 @@ int libewf_get_header_value_size( return( -1 ); } - identifier_length = libcstring_narrow_string_length( + identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_header_value_size( @@ -3559,7 +3558,7 @@ int libewf_get_header_value( return( -1 ); } - identifier_length = libcstring_narrow_string_length( + identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_header_value( @@ -3620,7 +3619,7 @@ int libewf_set_header_value( return( -1 ); } - identifier_length = libcstring_narrow_string_length( + identifier_length = narrow_string_length( identifier ); if( libewf_handle_set_header_value( @@ -3898,7 +3897,7 @@ int libewf_get_hash_value( return( -1 ); } - identifier_length = libcstring_narrow_string_length( + identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_hash_value( @@ -3957,7 +3956,7 @@ int libewf_get_hash_value_size( return( -1 ); } - identifier_length = libcstring_narrow_string_length( + identifier_length = narrow_string_length( identifier ); result = libewf_handle_get_hash_value_size( @@ -4015,7 +4014,7 @@ int libewf_set_hash_value( return( -1 ); } - identifier_length = libcstring_narrow_string_length( + identifier_length = narrow_string_length( identifier ); if( libewf_handle_set_hash_value( diff --git a/libewf/libewf_libcstring.h b/libewf/libewf_libcstring.h deleted file mode 100644 index 3764789..0000000 --- a/libewf/libewf_libcstring.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The internal libcstring header - * - * Copyright (c) 2006-2014, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBEWF_LIBCSTRING_H ) -#define _LIBEWF_LIBCSTRING_H - -#include - -/* Define HAVE_LOCAL_LIBCSTRING for local use of libcstring - */ -#if defined( HAVE_LOCAL_LIBCSTRING ) - -#include -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCSTRING_DLL_IMPORT - * before including libcstring.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCSTRING_DLL_IMPORT -#endif - -#include "libewf_libcstring.h" - -#endif - -#endif - diff --git a/libewf/libewf_metadata.c b/libewf/libewf_metadata.c index 945ad95..21fa692 100644 --- a/libewf/libewf_metadata.c +++ b/libewf/libewf_metadata.c @@ -21,6 +21,7 @@ #include #include +#include #include #include "libewf_codepage.h" @@ -32,7 +33,6 @@ #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" #include "libewf_libfvalue.h" #include "libewf_metadata.h" #include "libewf_sector_range.h" @@ -3305,7 +3305,7 @@ int libewf_handle_get_utf8_header_value_size( return( 0 ); } if( ( identifier_length == 16 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) @@ -3364,12 +3364,12 @@ int libewf_handle_get_utf8_header_value_size( return( 0 ); } if( ( ( identifier_length == 11 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) @@ -3516,7 +3516,7 @@ int libewf_handle_get_utf8_header_value( return( 0 ); } if( ( identifier_length == 16 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) @@ -3575,12 +3575,12 @@ int libewf_handle_get_utf8_header_value( return( 0 ); } if( ( ( identifier_length == 11 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) @@ -3875,7 +3875,7 @@ int libewf_handle_get_utf16_header_value_size( return( 0 ); } if( ( identifier_length == 16 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) @@ -3934,12 +3934,12 @@ int libewf_handle_get_utf16_header_value_size( return( 0 ); } if( ( ( identifier_length == 11 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) @@ -4086,7 +4086,7 @@ int libewf_handle_get_utf16_header_value( return( 0 ); } if( ( identifier_length == 16 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "compression_type", 16 ) == 0 ) ) @@ -4145,12 +4145,12 @@ int libewf_handle_get_utf16_header_value( return( 0 ); } if( ( ( identifier_length == 11 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "system_date", 11 ) == 0 ) ) || ( ( identifier_length == 12 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "acquiry_date", 12 ) == 0 ) ) ) @@ -5377,7 +5377,7 @@ int libewf_handle_set_utf8_hash_value( if( internal_handle->hash_sections != NULL ) { if( ( identifier_length == 3 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "MD5", identifier_length ) == 0 ) ) @@ -5416,7 +5416,7 @@ int libewf_handle_set_utf8_hash_value( } } else if( ( identifier_length == 4 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "SHA1", identifier_length ) == 0 ) ) @@ -5864,7 +5864,7 @@ int libewf_handle_set_utf16_hash_value( if( internal_handle->hash_sections != NULL ) { if( ( identifier_length == 3 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "MD5", identifier_length ) == 0 ) ) @@ -5903,7 +5903,7 @@ int libewf_handle_set_utf16_hash_value( } } else if( ( identifier_length == 4 ) - && ( libcstring_narrow_string_compare( + && ( narrow_string_compare( (char *) identifier, "SHA1", identifier_length ) == 0 ) ) diff --git a/libewf/libewf_section.c b/libewf/libewf_section.c index 38db8dd..7531f80 100644 --- a/libewf/libewf_section.c +++ b/libewf/libewf_section.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "libewf_checksum.h" @@ -36,7 +37,6 @@ #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" #include "libewf_section.h" @@ -556,7 +556,7 @@ ssize_t libewf_section_start_read( return( -1 ); } - section->type_length = libcstring_narrow_string_length( + section->type_length = narrow_string_length( (char *) section->type ); if( ( section->end_offset < file_offset ) diff --git a/libewf/libewf_segment_table.c b/libewf/libewf_segment_table.c index 7bbfd1d..0b2f494 100644 --- a/libewf/libewf_segment_table.c +++ b/libewf/libewf_segment_table.c @@ -21,14 +21,15 @@ #include #include +#include +#include #include - -#include "libewf_libcstring.h" -#include "libewf_libcerror.h" -#include "libewf_libclocale.h" +#include #include "libewf_libbfio.h" #include "libewf_libcdata.h" +#include "libewf_libcerror.h" +#include "libewf_libclocale.h" #include "libewf_libmfdata.h" #include "libewf_libuna.h" #include "libewf_segment_file.h" @@ -242,7 +243,7 @@ int libewf_segment_table_clone( } if( source_segment_table->basename != NULL ) { - ( *destination_segment_table )->basename = libcstring_system_string_allocate( + ( *destination_segment_table )->basename = system_string_allocate( source_segment_table->basename_size ); if( *destination_segment_table == NULL ) @@ -259,7 +260,7 @@ int libewf_segment_table_clone( if( memory_copy( ( *destination_segment_table )->basename, source_segment_table->basename, - sizeof( libcstring_system_character_t ) * source_segment_table->basename_size ) == NULL ) + sizeof( system_character_t ) * source_segment_table->basename_size ) == NULL ) { libcerror_error_set( error, @@ -318,7 +319,7 @@ int libewf_segment_table_get_basename_size( { static char *function = "libewf_segment_table_get_basename_size"; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif @@ -348,7 +349,7 @@ int libewf_segment_table_get_basename_size( { return( 0 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 @@ -400,7 +401,7 @@ int libewf_segment_table_get_basename_size( } #else *basename_size = segment_table->basename_size; -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } @@ -417,7 +418,7 @@ int libewf_segment_table_get_basename( static char *function = "libewf_segment_table_get_basename"; size_t narrow_basename_size = 0; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif @@ -447,7 +448,7 @@ int libewf_segment_table_get_basename( { return( 0 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 @@ -499,7 +500,7 @@ int libewf_segment_table_get_basename( } #else narrow_basename_size = segment_table->basename_size; -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( basename_size < narrow_basename_size ) { @@ -512,7 +513,7 @@ int libewf_segment_table_get_basename( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 @@ -567,7 +568,7 @@ int libewf_segment_table_get_basename( return( -1 ); } #else - if( libcstring_system_string_copy( + if( system_string_copy( basename, segment_table->basename, segment_table->basename_size ) == NULL ) @@ -582,7 +583,7 @@ int libewf_segment_table_get_basename( return( -1 ); } basename[ segment_table->basename_size - 1 ] = 0; -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } @@ -598,7 +599,7 @@ int libewf_segment_table_set_basename( { static char *function = "libewf_segment_table_set_basename"; -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif @@ -632,7 +633,7 @@ int libewf_segment_table_set_basename( segment_table->basename = NULL; segment_table->basename_size = 0; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 @@ -685,7 +686,7 @@ int libewf_segment_table_set_basename( #else segment_table->basename_size = basename_length + 1; #endif - segment_table->basename = libcstring_system_string_allocate( + segment_table->basename = system_string_allocate( segment_table->basename_size ); if( segment_table->basename == NULL ) @@ -701,7 +702,7 @@ int libewf_segment_table_set_basename( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libclocale_codepage == 0 ) { #if SIZEOF_WCHAR_T == 4 @@ -762,7 +763,7 @@ int libewf_segment_table_set_basename( return( -1 ); } #else - if( libcstring_system_string_copy( + if( system_string_copy( segment_table->basename, basename, basename_length ) == NULL ) @@ -783,7 +784,7 @@ int libewf_segment_table_set_basename( return( -1 ); } segment_table->basename[ basename_length ] = 0; -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } @@ -799,7 +800,7 @@ int libewf_segment_table_get_basename_size_wide( { static char *function = "libewf_segment_table_get_basename_size_wide"; -#if !defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif @@ -829,7 +830,7 @@ int libewf_segment_table_get_basename_size_wide( { return( 0 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) *basename_size = segment_table->basename_size; #else if( libclocale_codepage == 0 ) @@ -881,7 +882,7 @@ int libewf_segment_table_get_basename_size_wide( return( -1 ); } -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } @@ -897,7 +898,7 @@ int libewf_segment_table_get_basename_wide( static char *function = "libewf_segment_table_get_basename_wide"; size_t wide_basename_size = 0; -#if !defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif @@ -927,7 +928,7 @@ int libewf_segment_table_get_basename_wide( { return( 0 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) wide_basename_size = segment_table->basename_size; #else if( libclocale_codepage == 0 ) @@ -979,7 +980,7 @@ int libewf_segment_table_get_basename_wide( return( -1 ); } -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ if( basename_size < wide_basename_size ) { libcerror_error_set( @@ -991,8 +992,8 @@ int libewf_segment_table_get_basename_wide( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) - if( libcstring_system_string_copy( +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( system_string_copy( basename, segment_table->basename, segment_table->basename_size ) == NULL ) @@ -1061,7 +1062,7 @@ int libewf_segment_table_get_basename_wide( return( -1 ); } -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } @@ -1076,7 +1077,7 @@ int libewf_segment_table_set_basename_wide( { static char *function = "libewf_segment_table_set_basename_wide"; -#if !defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if !defined( HAVE_WIDE_SYSTEM_CHARACTER ) int result = 0; #endif @@ -1110,7 +1111,7 @@ int libewf_segment_table_set_basename_wide( segment_table->basename = NULL; segment_table->basename_size = 0; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) segment_table->basename_size = basename_length + 1; #else if( libclocale_codepage == 0 ) @@ -1162,8 +1163,8 @@ int libewf_segment_table_set_basename_wide( return( -1 ); } -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ - segment_table->basename = libcstring_system_string_allocate( +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ + segment_table->basename = system_string_allocate( segment_table->basename_size ); if( segment_table->basename == NULL ) @@ -1177,8 +1178,8 @@ int libewf_segment_table_set_basename_wide( return( -1 ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) - if( libcstring_system_string_copy( +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( system_string_copy( segment_table->basename, basename, basename_length ) == NULL ) @@ -1259,7 +1260,7 @@ int libewf_segment_table_set_basename_wide( return( -1 ); } -#endif /* defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) */ +#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */ return( 1 ); } #endif /* defined( HAVE_WIDE_CHARACTER_TYPE ) */ diff --git a/libewf/libewf_segment_table.h b/libewf/libewf_segment_table.h index c38494b..35d443e 100644 --- a/libewf/libewf_segment_table.h +++ b/libewf/libewf_segment_table.h @@ -25,11 +25,9 @@ #include #include -#include "libewf_libcstring.h" -#include "libewf_libcerror.h" - #include "libewf_libbfio.h" #include "libewf_libcdata.h" +#include "libewf_libcerror.h" #include "libewf_libmfdata.h" #include "libewf_media_values.h" @@ -43,7 +41,7 @@ struct libewf_segment_table { /* The basename */ - libcstring_system_character_t *basename; + system_character_t *basename; /* The basename size */ diff --git a/libewf/libewf_single_file_entry.c b/libewf/libewf_single_file_entry.c index 8c4813d..4c2aa04 100644 --- a/libewf/libewf_single_file_entry.c +++ b/libewf/libewf_single_file_entry.c @@ -21,10 +21,10 @@ #include #include +#include #include #include "libewf_libcerror.h" -#include "libewf_libcstring.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" #include "libewf_single_file_entry.h" @@ -634,7 +634,7 @@ int libewf_single_file_entry_get_utf8_name( return( -1 ); } - if( libcstring_narrow_string_copy( + if( narrow_string_copy( (char *) utf8_string, (char *) single_file_entry->name, single_file_entry->name_size ) == NULL ) diff --git a/libewf/libewf_single_files.c b/libewf/libewf_single_files.c index 332a872..2e9f803 100644 --- a/libewf/libewf_single_files.c +++ b/libewf/libewf_single_files.c @@ -27,7 +27,6 @@ #include "libewf_libcdata.h" #include "libewf_libcerror.h" #include "libewf_libcnotify.h" -#include "libewf_libcstring.h" #include "libewf_libfvalue.h" #include "libewf_libuna.h" #include "libewf_single_file_entry.h" @@ -1640,7 +1639,7 @@ int libewf_single_files_parse_file_entry( if( type_string[ 0 ] == (uint8_t) 'n' ) { single_file_entry->name = (uint8_t *) memory_allocate( - sizeof( uint8_t ) * value_string_size ); + sizeof( uint8_t ) * value_string_size ); if( single_file_entry->name == NULL ) { @@ -1653,7 +1652,7 @@ int libewf_single_files_parse_file_entry( goto on_error; } - if( libcstring_narrow_string_copy( + if( memory_copy( single_file_entry->name, value_string, value_string_size - 1 ) == NULL ) diff --git a/libewf/libewf_support.c b/libewf/libewf_support.c index e99881a..76ebc5a 100644 --- a/libewf/libewf_support.c +++ b/libewf/libewf_support.c @@ -20,20 +20,20 @@ */ #include +#include #include - -#include "libewf_libcstring.h" -#include "libewf_libcerror.h" -#include "libewf_libclocale.h" -#include "libewf_libcnotify.h" +#include #include #include "libewf_codepage.h" #include "libewf_definitions.h" -#include "libewf_filename.h" #include "libewf_error.h" +#include "libewf_filename.h" #include "libewf_libbfio.h" +#include "libewf_libcerror.h" +#include "libewf_libclocale.h" +#include "libewf_libcnotify.h" #include "libewf_segment_file.h" #include "libewf_support.h" @@ -187,7 +187,7 @@ int libewf_check_file_signature( return( -1 ); } - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( filename ); if( filename_length == 0 ) @@ -293,7 +293,7 @@ int libewf_check_file_signature_wide( return( -1 ); } - filename_length = libcstring_wide_string_length( + filename_length = wide_string_length( filename ); if( filename_length == 0 ) @@ -700,7 +700,7 @@ int libewf_glob( goto on_error; } - if( libcstring_narrow_string_copy( + if( narrow_string_copy( segment_filename, filename, filename_length ) == NULL ) @@ -1058,7 +1058,7 @@ int libewf_glob_wide( goto on_error; } - if( libcstring_wide_string_copy( + if( wide_string_copy( segment_filename, filename, filename_length ) == NULL ) diff --git a/libewf/libewf_write_io_handle.c b/libewf/libewf_write_io_handle.c index d42b65f..c8bd058 100644 --- a/libewf/libewf_write_io_handle.c +++ b/libewf/libewf_write_io_handle.c @@ -1987,11 +1987,11 @@ int libewf_write_io_handle_create_segment_file( int *file_io_pool_entry, libcerror_error_t **error ) { - libbfio_handle_t *file_io_handle = NULL; - libcstring_system_character_t *filename = NULL; - static char *function = "libewf_write_io_handle_create_segment_file"; - size_t filename_size = 0; - int bfio_access_flags = 0; + libbfio_handle_t *file_io_handle = NULL; + system_character_t *filename = NULL; + static char *function = "libewf_write_io_handle_create_segment_file"; + size_t filename_size = 0; + int bfio_access_flags = 0; if( segment_table == NULL ) { @@ -2096,7 +2096,7 @@ int libewf_write_io_handle_create_segment_file( if( libcnotify_verbose != 0 ) { libcnotify_printf( - "%s: creating segment file: %" PRIu16 " with filename: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "%s: creating segment file: %" PRIu16 " with filename: %" PRIs_SYSTEM ".\n", function, segment_number, filename ); @@ -2115,7 +2115,7 @@ int libewf_write_io_handle_create_segment_file( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libbfio_file_set_name_wide( file_io_handle, filename, diff --git a/libmfdata/Makefile.am b/libmfdata/Makefile.am index edbde42..45be3a0 100644 --- a/libmfdata/Makefile.am +++ b/libmfdata/Makefile.am @@ -2,7 +2,6 @@ if HAVE_LOCAL_LIBMFDATA AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @@ -28,7 +27,6 @@ libmfdata_la_SOURCES = \ libmfdata_libcdata.h \ libmfdata_libcerror.h \ libmfdata_libcnotify.h \ - libmfdata_libcstring.h \ libmfdata_libfcache.h \ libmfdata_list.c libmfdata_list.h \ libmfdata_list_element.c libmfdata_list_element.h \ diff --git a/libmfdata/libmfdata_libcstring.h b/libmfdata/libmfdata_libcstring.h deleted file mode 100644 index 0ffe211..0000000 --- a/libmfdata/libmfdata_libcstring.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The internal libcstring header - * - * Copyright (c) 2010-2013, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _LIBMFDATA_LIBCSTRING_H ) -#define _LIBMFDATA_LIBCSTRING_H - -#include - -/* Define HAVE_LOCAL_LIBCSTRING for local use of libcstring - */ -#if defined( HAVE_LOCAL_LIBCSTRING ) - -#include -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCSTRING_DLL_IMPORT - * before including libcstring.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCSTRING_DLL_IMPORT -#endif - -#include - -#endif - -#endif - diff --git a/m4/libcstring.m4 b/m4/libcstring.m4 deleted file mode 100644 index bf25bf0..0000000 --- a/m4/libcstring.m4 +++ /dev/null @@ -1,304 +0,0 @@ -dnl Functions for libcstring -dnl -dnl Version: 20141014 - -dnl Function to detect if libcstring is available -dnl ac_libcstring_dummy is used to prevent AC_CHECK_LIB adding unnecessary -l arguments -AC_DEFUN([AX_LIBCSTRING_CHECK_LIB], - [dnl Check if parameters were provided - AS_IF( - [test "x$ac_cv_with_libcstring" != x && test "x$ac_cv_with_libcstring" != xno && test "x$ac_cv_with_libcstring" != xauto-detect], - [AS_IF( - [test -d "$ac_cv_with_libcstring"], - [CFLAGS="$CFLAGS -I${ac_cv_with_libcstring}/include" - LDFLAGS="$LDFLAGS -L${ac_cv_with_libcstring}/lib"], - [AC_MSG_WARN([no such directory: $ac_cv_with_libcstring]) - ]) - ]) - - AS_IF( - [test "x$ac_cv_with_libcstring" = xno], - [ac_cv_libcstring=no], - [AS_IF( - [test "x$ac_cv_header_libcstring_h" = xno], - [ac_cv_libcstring=no], - [dnl Check for a pkg-config file - AS_IF( - [test "x$cross_compiling" != "xyes" && test "x$PKGCONFIG" != "x"], - [PKG_CHECK_MODULES( - [libcstring], - [libcstring >= 20120425], - [ac_cv_libcstring=yes], - [ac_cv_libcstring=no]) - ]) - ]) - - AS_IF( - [test "x$ac_cv_libcstring" = xyes], - [ac_cv_libcstring_CPPFLAGS="$pkg_cv_libcstring_CFLAGS" - ac_cv_libcstring_LIBADD="$pkg_cv_libcstring_LIBS"], - [dnl Check for headers - AC_CHECK_HEADERS([libcstring.h]) - - AS_IF( - [test "x$ac_cv_header_libcstring_h" = xno], - [ac_cv_libcstring=no], - [dnl Check for the individual functions - ac_cv_libcstring=yes - - AC_CHECK_LIB( - cstring, - libcstring_get_version, - [ac_cv_libcstring_dummy=yes], - [ac_cv_libcstring=no]) - - ac_cv_libcstring_LIBADD="-lcstring" - ]) - ]) - ]) - - AS_IF( - [test "x$ac_cv_libcstring" = xyes], - [AC_DEFINE( - [HAVE_LIBCSTRING], - [1], - [Define to 1 if you have the `cstring' library (-lcstring).]) - ]) - - AS_IF( - [test "x$ac_cv_libcstring" = xyes], - [AC_SUBST( - [HAVE_LIBCSTRING], - [1]) ], - [AC_SUBST( - [HAVE_LIBCSTRING], - [0]) - ]) - ]) - -dnl Function to detect if libcstring dependencies are available -AC_DEFUN([AX_LIBCSTRING_CHECK_LOCAL], - [dnl Headers included in libcstring/libcstring_narrow_string.h - AC_CHECK_HEADERS([stdlib.h string.h]) - - dnl Headers included in libcstring/libcstring_wide.h - AC_CHECK_HEADERS([wchar.h wctype.h]) - - dnl Narrow character string functions used in libcstring/libcstring_narrow_string.h - AC_CHECK_FUNCS([fgets memchr memcmp memcpy memrchr snprintf sscanf strcasecmp strchr strlen strncasecmp strncmp strncpy strnicmp strrchr strstr vsnprintf]) - - AS_IF( - [test "x$ac_cv_func_fgets" != xyes], - [AC_MSG_FAILURE( - [Missing function: fgets], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_memchr" != xyes && test "x$ac_cv_func_strchr" != xyes], - [AC_MSG_FAILURE( - [Missing functions: memchr and strchr], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_memcmp" != xyes && test "x$ac_cv_func_strncmp" != xyes], - [AC_MSG_FAILURE( - [Missing functions: memcmp and strncmp], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_memcpy" != xyes && test "x$ac_cv_func_strncpy" != xyes], - [AC_MSG_FAILURE( - [Missing functions: memcpy and strncpy], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_memrchr" = xyes], - [AC_CHECK_DECLS([memrchr]) - - AS_IF( - [test "x$ac_cv_decl_memrchr" != xyes], - [ac_cv_func_memrchr=no]) - ]) - - AS_IF( - [test "x$ac_cv_func_memrchr" != xyes && test "x$ac_cv_func_strrchr" != xyes], - [AC_MSG_FAILURE( - [Missing functions: strrchr and memrchr], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_snprintf" != xyes], - [AC_MSG_FAILURE( - [Missing function: snprintf], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_sscanf" != xyes], - [AC_MSG_FAILURE( - [Missing function: sscanf], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_strlen" != xyes], - [AC_MSG_FAILURE( - [Missing function: strlen], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_strcasecmp" != xyes && test "x$ac_cv_func_strncasecmp" != xyes && test "x$ac_cv_func_strnicmp" != xyes], - [AC_MSG_FAILURE( - [Missing functions: strncasecmp, strcasecmp and strnicmp], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_strstr" != xyes], - [AC_MSG_FAILURE( - [Missing function: strstr], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_strstr" != xyes], - [AC_MSG_FAILURE( - [Missing function: vsnprintf], - [1]) - ]) - - dnl Wide character string functions used in libcstring/libcstring_wide_string.h - AS_IF( - [test "x$ac_cv_enable_wide_character_type" != xno], - [AC_CHECK_FUNCS([swprintf towlower wcscasecmp wcschr wcslen wcsncasecmp wcsncmp wcsncpy wcsnicmp wcsrchr wcsstr wmemchr wmemcmp wmemcpy wmemrchr]) - - AS_IF( - [test "x$ac_cv_func_swprintf" != xyes], - [AC_MSG_FAILURE( - [Missing function: swprintf], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_wmemchr" != xyes && test "x$ac_cv_func_wcschr" != xyes], - [AC_MSG_FAILURE( - [Missing functions: wmemchr and wcschr], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_wmemcmp" != xyes && test "x$ac_cv_func_wcsncmp" != xyes], - [AC_MSG_FAILURE( - [Missing functions: wmemcmp and wcsncmp], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_wmemcpy" != xyes && test "x$ac_cv_func_wcsncpy" != xyes], - [AC_MSG_FAILURE( - [Missing functions: wmemcpy and wcsncpy], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_wmemrchr" != xyes && test "x$ac_cv_func_wcsrchr" != xyes], - [AC_MSG_FAILURE( - [Missing functions: wmemrchr and wcsrchr], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_wcslen" != xyes], - [AC_MSG_FAILURE( - [Missing function: wcslen], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_wcsncasecmp" != xyes && test "x$ac_cv_func_wcscasecmp" != xyes && test "x$ac_cv_func_wcsnicmp" != xyes && test "x$ac_cv_func_towlower" != xyes], - [AC_MSG_FAILURE( - [Missing functions: wcsncasecmp, wcscasecmp, wcsnicmp and towlower], - [1]) - ]) - - AS_IF( - [test "x$ac_cv_func_wcsstr" != xyes], - [AC_MSG_FAILURE( - [Missing function: wcsstr], - [1]) - ]) - ]) - ]) - -dnl Function to detect how to enable libcstring -AC_DEFUN([AX_LIBCSTRING_CHECK_ENABLE], - [AX_COMMON_ARG_WITH( - [libcstring], - [libcstring], - [search for libcstring in includedir and libdir or in the specified DIR, or no if to use local version], - [auto-detect], - [DIR]) - - dnl Check for a shared library version - AX_LIBCSTRING_CHECK_LIB - - dnl Always check the dependencies - AX_LIBCSTRING_CHECK_LOCAL - - dnl Check if the dependencies for the local library version - AS_IF( - [test "x$ac_cv_libcstring" != xyes], - [ac_cv_libcstring_CPPFLAGS="-I../libcstring"; - ac_cv_libcstring_LIBADD="../libcstring/libcstring.la"; - - ac_cv_libcstring=local - - AC_DEFINE( - [HAVE_LOCAL_LIBCSTRING], - [1], - [Define to 1 if the local version of libcstring is used.]) - AC_SUBST( - [HAVE_LOCAL_LIBCSTRING], - [1]) - ]) - - AM_CONDITIONAL( - [HAVE_LOCAL_LIBCSTRING], - [test "x$ac_cv_libcstring" = xlocal]) - AS_IF( - [test "x$ac_cv_libcstring_CPPFLAGS" != "x"], - [AC_SUBST( - [LIBCSTRING_CPPFLAGS], - [$ac_cv_libcstring_CPPFLAGS]) - ]) - AS_IF( - [test "x$ac_cv_libcstring_LIBADD" != "x"], - [AC_SUBST( - [LIBCSTRING_LIBADD], - [$ac_cv_libcstring_LIBADD]) - ]) - - AS_IF( - [test "x$ac_cv_libcstring" = xyes], - [AC_SUBST( - [ax_libcstring_pc_libs_private], - [-lcstring]) - ]) - - AS_IF( - [test "x$ac_cv_libcstring" = xyes], - [AC_SUBST( - [ax_libcstring_spec_requires], - [libcstring]) - AC_SUBST( - [ax_libcstring_spec_build_requires], - [libcstring-devel]) - ]) - ]) - diff --git a/msvscpp/Makefile.am b/msvscpp/Makefile.am index b4b9ef2..29145f0 100644 --- a/msvscpp/Makefile.am +++ b/msvscpp/Makefile.am @@ -25,7 +25,6 @@ MSVSCPP_FILES = \ libcnotify/libcnotify.vcproj \ libcpath/libcpath.vcproj \ libcsplit/libcsplit.vcproj \ - libcstring/libcstring.vcproj \ libcthreads/libcthreads.vcproj \ libewf/libewf.vcproj \ libfcache/libfcache.vcproj \ diff --git a/msvscpp/ewf_test_glob/ewf_test_glob.vcproj b/msvscpp/ewf_test_glob/ewf_test_glob.vcproj index 9713824..5febcd3 100644 --- a/msvscpp/ewf_test_glob/ewf_test_glob.vcproj +++ b/msvscpp/ewf_test_glob/ewf_test_glob.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewf_test_read/ewf_test_read.vcproj b/msvscpp/ewf_test_read/ewf_test_read.vcproj index bffe6b1..0352ac0 100644 --- a/msvscpp/ewf_test_read/ewf_test_read.vcproj +++ b/msvscpp/ewf_test_read/ewf_test_read.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewf_test_read_write/ewf_test_read_write.vcproj b/msvscpp/ewf_test_read_write/ewf_test_read_write.vcproj index 3aa70ad..534b095 100644 --- a/msvscpp/ewf_test_read_write/ewf_test_read_write.vcproj +++ b/msvscpp/ewf_test_read_write/ewf_test_read_write.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewf_test_truncate/ewf_test_truncate.vcproj b/msvscpp/ewf_test_truncate/ewf_test_truncate.vcproj index f06e788..5d8b8e8 100644 --- a/msvscpp/ewf_test_truncate/ewf_test_truncate.vcproj +++ b/msvscpp/ewf_test_truncate/ewf_test_truncate.vcproj @@ -41,8 +41,8 @@ /> - - - - diff --git a/msvscpp/ewfacquirestream/ewfacquirestream.vcproj b/msvscpp/ewfacquirestream/ewfacquirestream.vcproj index 6e3dd50..3db922f 100644 --- a/msvscpp/ewfacquirestream/ewfacquirestream.vcproj +++ b/msvscpp/ewfacquirestream/ewfacquirestream.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewfdebug/ewfdebug.vcproj b/msvscpp/ewfdebug/ewfdebug.vcproj index ad58b0d..d97f5f2 100644 --- a/msvscpp/ewfdebug/ewfdebug.vcproj +++ b/msvscpp/ewfdebug/ewfdebug.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewfexport/ewfexport.vcproj b/msvscpp/ewfexport/ewfexport.vcproj index f57f72d..5fc0ea8 100644 --- a/msvscpp/ewfexport/ewfexport.vcproj +++ b/msvscpp/ewfexport/ewfexport.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewfinfo/ewfinfo.vcproj b/msvscpp/ewfinfo/ewfinfo.vcproj index 2949dd5..eb28712 100644 --- a/msvscpp/ewfinfo/ewfinfo.vcproj +++ b/msvscpp/ewfinfo/ewfinfo.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewfmount/ewfmount.vcproj b/msvscpp/ewfmount/ewfmount.vcproj index 24e803f..469bcca 100644 --- a/msvscpp/ewfmount/ewfmount.vcproj +++ b/msvscpp/ewfmount/ewfmount.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewfrecover/ewfrecover.vcproj b/msvscpp/ewfrecover/ewfrecover.vcproj index 1a8d9f0..cb30fbe 100644 --- a/msvscpp/ewfrecover/ewfrecover.vcproj +++ b/msvscpp/ewfrecover/ewfrecover.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/ewfverify/ewfverify.vcproj b/msvscpp/ewfverify/ewfverify.vcproj index 785f59a..63e13ad 100644 --- a/msvscpp/ewfverify/ewfverify.vcproj +++ b/msvscpp/ewfverify/ewfverify.vcproj @@ -41,8 +41,8 @@ /> - - diff --git a/msvscpp/libcstring/libcstring.vcproj b/msvscpp/libcstring/libcstring.vcproj deleted file mode 100644 index 41ccba3..0000000 --- a/msvscpp/libcstring/libcstring.vcproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/msvscpp/libewf.sln b/msvscpp/libewf.sln index 0e4a727..1ecf183 100644 --- a/msvscpp/libewf.sln +++ b/msvscpp/libewf.sln @@ -15,7 +15,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfcache", "libfcache\libf EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyewf", "pyewf\pyewf.vcproj", "{6BB1CCE5-4FF5-4306-B3EB-1A3818FC3AC7}" ProjectSection(ProjectDependencies) = postProject - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} = {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} @@ -29,7 +28,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyewf", "pyewf\pyewf.vcproj EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmfdata", "libmfdata\libmfdata.vcproj", "{78A3701B-F395-4C5C-BDA9-B66A6E637B6F}" ProjectSection(ProjectDependencies) = postProject - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} = {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} @@ -66,35 +64,32 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_glob", "ewf_test_glob\ewf_test_glob.vcproj", "{3F4557A3-9155-418D-BD0F-0DF116A303C7}" ProjectSection(ProjectDependencies) = postProject {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_read", "ewf_test_read\ewf_test_read.vcproj", "{257A065A-FDA2-49D4-964C-BAF641FA6DD4}" ProjectSection(ProjectDependencies) = postProject {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_read_write", "ewf_test_read_write\ewf_test_read_write.vcproj", "{298FAA87-9F70-4B2A-ABF1-07D91AB677B6}" ProjectSection(ProjectDependencies) = postProject + {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_read_write_delta", "ewf_test_read_write_delta\ewf_test_read_write_delta.vcproj", "{82454223-CBF2-44DE-8BE0-307B020107A6}" ProjectSection(ProjectDependencies) = postProject + {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_seek", "ewf_test_seek\ewf_test_seek.vcproj", "{830695C8-09B5-4A38-BC6D-5936FFE941F6}" ProjectSection(ProjectDependencies) = postProject {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_truncate", "ewf_test_truncate\ewf_test_truncate.vcproj", "{7ACE2E3A-17CB-4970-B215-FC723B2E60DE}" @@ -104,21 +99,20 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_truncate", "ewf_te {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_write", "ewf_test_write\ewf_test_write.vcproj", "{261BF89F-4760-4473-828D-5F6EDCB80459}" ProjectSection(ProjectDependencies) = postProject + {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewf_test_write_chunk", "ewf_test_write_chunk\ewf_test_write_chunk.vcproj", "{5F3A8BCC-9792-4B26-87D8-0E1179575D24}" ProjectSection(ProjectDependencies) = postProject + {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} = {610F33E3-5FBB-4749-9C3F-6D4BC90BEA70} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libclocale", "libclocale\libclocale.vcproj", "{F8917954-3C5E-4791-A769-2EAC495108BA}" @@ -152,7 +146,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbfio", "libbfio\libbfio. EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libewf", "libewf\libewf.vcproj", "{610F33E3-5FBB-4749-9C3F-6D4BC90BEA70}" ProjectSection(ProjectDependencies) = postProject - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} = {7F48DE1B-9EE1-4D5F-96C3-58DFD6DB996E} {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} = {B444F82C-2C73-469F-A6D4-B097B5EA3ADE} @@ -215,8 +208,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libhmac", "libhmac\libhmac. {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcstring", "libcstring\libcstring.vcproj", "{2EBB055B-7729-4832-A404-EBB0B866D849}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libuna", "libuna\libuna.vcproj", "{B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72}" ProjectSection(ProjectDependencies) = postProject {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} @@ -257,7 +248,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfacquire", "ewfacquire\ew {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfacquirestream", "ewfacquirestream\ewfacquirestream.vcproj", "{C1C4F39C-2972-4FF7-BD41-8CCAF855E820}" @@ -270,7 +260,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfacquirestream", "ewfacqu {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfdebug", "ewfdebug\ewfdebug.vcproj", "{EEDECB53-5052-4431-A8D4-289701D5483C}" @@ -280,7 +269,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfdebug", "ewfdebug\ewfdeb {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfexport", "ewfexport\ewfexport.vcproj", "{8578D675-38BC-423B-82B4-848ED17A3F6A}" @@ -300,7 +288,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfexport", "ewfexport\ewfe {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfinfo", "ewfinfo\ewfinfo.vcproj", "{B56C4FFE-B106-46DC-9E29-4CC8B1FFB7BB}" @@ -311,7 +298,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfinfo", "ewfinfo\ewfinfo. {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfmount", "ewfmount\ewfmount.vcproj", "{2291E484-B893-4F6E-A7B7-55CAF36A4687}" @@ -343,7 +329,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfrecover", "ewfrecover\ew {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfverify", "ewfverify\ewfverify.vcproj", "{B221A1F2-155B-450A-9929-EB0FBA906432}" @@ -357,7 +342,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ewfverify", "ewfverify\ewfv {94445D9A-BF51-4280-B577-69A0279E4873} = {94445D9A-BF51-4280-B577-69A0279E4873} {F8917954-3C5E-4791-A769-2EAC495108BA} = {F8917954-3C5E-4791-A769-2EAC495108BA} {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} = {EBDF4B5C-2DB4-41F8-8A4A-B9A4FFB5CC92} - {2EBB055B-7729-4832-A404-EBB0B866D849} = {2EBB055B-7729-4832-A404-EBB0B866D849} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfdata", "libfdata\libfdata.vcproj", "{2CA07FF7-1F1C-4165-A7EC-C5155F697166}" @@ -484,10 +468,6 @@ Global {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD}.Release|Win32.Build.0 = Release|Win32 {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 {53DD6B32-CAF2-4360-B6C1-3BE4A20535BD}.VSDebug|Win32.Build.0 = VSDebug|Win32 - {2EBB055B-7729-4832-A404-EBB0B866D849}.Release|Win32.ActiveCfg = Release|Win32 - {2EBB055B-7729-4832-A404-EBB0B866D849}.Release|Win32.Build.0 = Release|Win32 - {2EBB055B-7729-4832-A404-EBB0B866D849}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 - {2EBB055B-7729-4832-A404-EBB0B866D849}.VSDebug|Win32.Build.0 = VSDebug|Win32 {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72}.Release|Win32.ActiveCfg = Release|Win32 {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72}.Release|Win32.Build.0 = Release|Win32 {B38F0C9F-F1E0-4CE2-9D8D-C68C56122B72}.VSDebug|Win32.ActiveCfg = VSDebug|Win32 diff --git a/msvscpp/libewf/libewf.vcproj b/msvscpp/libewf/libewf.vcproj index f4a77c0..f32d842 100644 --- a/msvscpp/libewf/libewf.vcproj +++ b/msvscpp/libewf/libewf.vcproj @@ -39,8 +39,8 @@ /> - - diff --git a/msvscpp/libmfdata/libmfdata.vcproj b/msvscpp/libmfdata/libmfdata.vcproj index da72fa1..1ee1089 100644 --- a/msvscpp/libmfdata/libmfdata.vcproj +++ b/msvscpp/libmfdata/libmfdata.vcproj @@ -39,8 +39,8 @@ /> - - diff --git a/msvscpp/pyewf/pyewf.vcproj b/msvscpp/pyewf/pyewf.vcproj index 33b295f..a68deea 100644 --- a/msvscpp/pyewf/pyewf.vcproj +++ b/msvscpp/pyewf/pyewf.vcproj @@ -39,8 +39,8 @@ /> - - diff --git a/pyewf-python2/Makefile.am b/pyewf-python2/Makefile.am index 7da19de..cb61c57 100644 --- a/pyewf-python2/Makefile.am +++ b/pyewf-python2/Makefile.am @@ -8,7 +8,6 @@ if HAVE_PYTHON2 AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @@ -34,7 +33,6 @@ BUILT_SOURCES = \ pyewf_libbfio.h \ pyewf_libcerror.h \ pyewf_libclocale.h \ - pyewf_libcstring.h \ pyewf_libewf.h \ pyewf_metadata.c pyewf_metadata.h \ pyewf_python.h \ @@ -45,7 +43,6 @@ pyexec_LTLIBRARIES = pyewf.la nodist_pyewf_la_SOURCES = $(BUILT_SOURCES) pyewf_la_LIBADD = \ - @LIBCSTRING_LIBADD@ \ @LIBCERROR_LIBADD@ \ ../libewf/libewf.la @LIBCDATA_LIBADD@ \ diff --git a/pyewf-python3/Makefile.am b/pyewf-python3/Makefile.am index de3a4bd..a566c43 100644 --- a/pyewf-python3/Makefile.am +++ b/pyewf-python3/Makefile.am @@ -8,7 +8,6 @@ if HAVE_PYTHON3 AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @@ -34,7 +33,6 @@ BUILT_SOURCES = \ pyewf_libbfio.h \ pyewf_libcerror.h \ pyewf_libclocale.h \ - pyewf_libcstring.h \ pyewf_libewf.h \ pyewf_metadata.c pyewf_metadata.h \ pyewf_python.h \ @@ -45,7 +43,6 @@ pyexec_LTLIBRARIES = pyewf.la nodist_pyewf_la_SOURCES = $(BUILT_SOURCES) pyewf_la_LIBADD = \ - @LIBCSTRING_LIBADD@ \ @LIBCERROR_LIBADD@ \ ../libewf/libewf.la @LIBCDATA_LIBADD@ \ diff --git a/pyewf/Makefile.am b/pyewf/Makefile.am index d27bd89..340be1b 100644 --- a/pyewf/Makefile.am +++ b/pyewf/Makefile.am @@ -2,7 +2,6 @@ if HAVE_PYTHON AM_CFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCDATA_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @@ -28,14 +27,12 @@ pyewf_la_SOURCES = \ pyewf_libbfio.h \ pyewf_libcerror.h \ pyewf_libclocale.h \ - pyewf_libcstring.h \ pyewf_libewf.h \ pyewf_metadata.c pyewf_metadata.h \ pyewf_python.h \ pyewf_unused.h pyewf_la_LIBADD = \ - @LIBCSTRING_LIBADD@ \ @LIBCERROR_LIBADD@ \ ../libewf/libewf.la @LIBCDATA_LIBADD@ \ diff --git a/pyewf/pyewf.c b/pyewf/pyewf.c index b8a4914..1c60562 100644 --- a/pyewf/pyewf.c +++ b/pyewf/pyewf.c @@ -21,6 +21,7 @@ */ #include +#include #include #if defined( HAVE_STDLIB_H ) @@ -34,7 +35,6 @@ #include "pyewf_file_object_io_handle.h" #include "pyewf_handle.h" #include "pyewf_libcerror.h" -#include "pyewf_libcstring.h" #include "pyewf_libewf.h" #include "pyewf_python.h" #include "pyewf_unused.h" @@ -115,7 +115,7 @@ PyObject *pyewf_get_version( Py_END_ALLOW_THREADS - version_string_length = libcstring_narrow_string_length( + version_string_length = narrow_string_length( version_string ); /* Pass the string length to PyUnicode_DecodeUTF8 @@ -318,7 +318,7 @@ PyObject *pyewf_glob( { return( NULL ); } - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( filename ); if( libewf_glob( @@ -347,7 +347,7 @@ PyObject *pyewf_glob( filename_index < number_of_filenames; filename_index++ ) { - filename_length = libcstring_narrow_string_length( + filename_length = narrow_string_length( filenames[ filename_index ] ); /* Pass the string length to PyUnicode_DecodeUTF8 diff --git a/pyewf/pyewf_file_entry.c b/pyewf/pyewf_file_entry.c index 38a13c6..205fc05 100644 --- a/pyewf/pyewf_file_entry.c +++ b/pyewf/pyewf_file_entry.c @@ -34,7 +34,6 @@ #include "pyewf_file_entry.h" #include "pyewf_integer.h" #include "pyewf_libcerror.h" -#include "pyewf_libcstring.h" #include "pyewf_libewf.h" #include "pyewf_metadata.h" #include "pyewf_python.h" diff --git a/pyewf/pyewf_file_objects_io_pool.c b/pyewf/pyewf_file_objects_io_pool.c index b7a9b59..9472f2c 100644 --- a/pyewf/pyewf_file_objects_io_pool.c +++ b/pyewf/pyewf_file_objects_io_pool.c @@ -27,7 +27,6 @@ #include "pyewf_integer.h" #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" -#include "pyewf_libcstring.h" #include "pyewf_python.h" /* Initializes the file objects IO pool diff --git a/pyewf/pyewf_handle.c b/pyewf/pyewf_handle.c index 7b28a72..7b8e708 100644 --- a/pyewf/pyewf_handle.c +++ b/pyewf/pyewf_handle.c @@ -37,7 +37,6 @@ #include "pyewf_integer.h" #include "pyewf_libbfio.h" #include "pyewf_libcerror.h" -#include "pyewf_libcstring.h" #include "pyewf_libewf.h" #include "pyewf_metadata.h" #include "pyewf_python.h" diff --git a/pyewf/pyewf_libcstring.h b/pyewf/pyewf_libcstring.h deleted file mode 100644 index 6089d69..0000000 --- a/pyewf/pyewf_libcstring.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The internal libcstring header - * - * Copyright (c) 2008-2014, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _PYEWF_LIBCSTRING_H ) -#define _PYEWF_LIBCSTRING_H - -#include - -/* Define HAVE_LOCAL_LIBCSTRING for local use of libcstring - */ -#if defined( HAVE_LOCAL_LIBCSTRING ) - -#include -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCSTRING_DLL_IMPORT - * before including libcstring.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCSTRING_DLL_IMPORT -#endif - -#include - -#endif - -#endif - diff --git a/pyewf/pyewf_metadata.c b/pyewf/pyewf_metadata.c index 880b7b9..a1d9646 100644 --- a/pyewf/pyewf_metadata.c +++ b/pyewf/pyewf_metadata.c @@ -21,6 +21,7 @@ */ #include +#include #include #include "pyewf_codepage.h" @@ -29,7 +30,6 @@ #include "pyewf_integer.h" #include "pyewf_libcerror.h" #include "pyewf_libclocale.h" -#include "pyewf_libcstring.h" #include "pyewf_libewf.h" #include "pyewf_metadata.h" #include "pyewf_python.h" @@ -187,7 +187,7 @@ int pyewf_handle_set_header_codepage_from_string( return( -1 ); } - codepage_string_length = libcstring_narrow_string_length( + codepage_string_length = narrow_string_length( codepage_string ); feature_flags = LIBCLOCALE_CODEPAGE_FEATURE_FLAG_HAVE_KOI8 @@ -426,7 +426,7 @@ PyObject *pyewf_handle_get_header_value( { return( NULL ); } - header_value_identifier_length = libcstring_narrow_string_length( + header_value_identifier_length = narrow_string_length( header_value_identifier ); Py_BEGIN_ALLOW_THREADS @@ -667,7 +667,7 @@ PyObject *pyewf_handle_get_header_values( goto on_error; } - header_value_identifier_length = libcstring_narrow_string_length( + header_value_identifier_length = narrow_string_length( header_value_identifier ); Py_BEGIN_ALLOW_THREADS @@ -845,7 +845,7 @@ PyObject *pyewf_handle_get_hash_value( { return( NULL ); } - hash_value_identifier_length = libcstring_narrow_string_length( + hash_value_identifier_length = narrow_string_length( hash_value_identifier ); Py_BEGIN_ALLOW_THREADS @@ -1086,7 +1086,7 @@ PyObject *pyewf_handle_get_hash_values( goto on_error; } - hash_value_identifier_length = libcstring_narrow_string_length( + hash_value_identifier_length = narrow_string_length( hash_value_identifier ); Py_BEGIN_ALLOW_THREADS diff --git a/synclibs.ps1 b/synclibs.ps1 index a81afde..236e0a2 100644 --- a/synclibs.ps1 +++ b/synclibs.ps1 @@ -7,7 +7,7 @@ Param ( ) $GitUrlPrefix = "https://github.com/libyal" -$LocalLibs = "libbfio libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcstring libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna" +$LocalLibs = "libbfio libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna" $LocalLibs = ${LocalLibs} -split " " $Git = "git" diff --git a/synclibs.sh b/synclibs.sh index 1b27bfc..97d4f62 100755 --- a/synclibs.sh +++ b/synclibs.sh @@ -7,7 +7,7 @@ EXIT_SUCCESS=0; EXIT_FAILURE=1; GIT_URL_PREFIX="https://github.com/libyal"; -LOCAL_LIBS="libbfio libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcstring libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna"; +LOCAL_LIBS="libbfio libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna"; OLDIFS=$IFS; IFS=" "; diff --git a/syncsharedlibs.sh b/syncsharedlibs.sh index 69ca8ab..a918483 100755 --- a/syncsharedlibs.sh +++ b/syncsharedlibs.sh @@ -7,7 +7,7 @@ EXIT_SUCCESS=0; EXIT_FAILURE=1; GIT_URL_PREFIX="https://github.com/libyal"; -SHARED_LIBS="libbfio libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcstring libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna"; +SHARED_LIBS="libbfio libcdata libcdatetime libcerror libcfile libclocale libcnotify libcpath libcsplit libcthreads libfcache libfdata libfguid libfvalue libhmac libodraw libsmdev libsmraw libuna"; if test "${TRAVIS_OS_NAME}" != "linux"; then diff --git a/tests/Makefile.am b/tests/Makefile.am index b386e05..a8bed05 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,6 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/common \ - @LIBCSTRING_CPPFLAGS@ \ @LIBCERROR_CPPFLAGS@ \ @LIBCLOCALE_CPPFLAGS@ \ @LIBCNOTIFY_CPPFLAGS@ \ @@ -64,67 +63,60 @@ check_PROGRAMS = \ ewf_test_glob_SOURCES = \ ewf_test_glob.c \ - ewf_test_libcstring.h \ ewf_test_libewf.h ewf_test_glob_LDADD = \ - ../libewf/libewf.la \ - @LIBCSTRING_LIBADD@ + ../libewf/libewf.la ewf_test_read_SOURCES = \ ewf_test_definitions.h \ ewf_test_libcerror.h \ - ewf_test_libcstring.h \ ewf_test_libewf.h \ ewf_test_read.c ewf_test_read_LDADD = \ ../libewf/libewf.la \ - @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ + @LIBCERROR_LIBADD@ ewf_test_read_write_SOURCES = \ ewf_test_definitions.h \ ewf_test_getopt.c ewf_test_getopt.h \ ewf_test_libcerror.h \ - ewf_test_libcstring.h \ + ewf_test_libcnotify.h \ ewf_test_libewf.h \ ewf_test_read_write.c ewf_test_read_write_LDADD = \ + @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ - @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ + @LIBCERROR_LIBADD@ ewf_test_read_write_delta_SOURCES = \ ewf_test_definitions.h \ ewf_test_getopt.c ewf_test_getopt.h \ ewf_test_libcerror.h \ - ewf_test_libcstring.h \ + ewf_test_libcnotify.h \ ewf_test_libewf.h \ ewf_test_read_write_delta.c ewf_test_read_write_delta_LDADD = \ + @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ - @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ + @LIBCERROR_LIBADD@ ewf_test_seek_SOURCES = \ ewf_test_libcerror.h \ - ewf_test_libcstring.h \ ewf_test_libewf.h \ ewf_test_seek.c ewf_test_seek_LDADD = \ ../libewf/libewf.la \ - @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ + @LIBCERROR_LIBADD@ ewf_test_truncate_SOURCES = \ ewf_test_libcerror.h \ ewf_test_libcfile.h \ ewf_test_libcnotify.h \ - ewf_test_libcstring.h \ ewf_test_truncate.c ewf_test_truncate_LDADD = \ @@ -132,34 +124,33 @@ ewf_test_truncate_LDADD = \ @LIBUNA_LIBADD@ \ @LIBCNOTIFY_LIBADD@ \ @LIBCLOCALE_LIBADD@ \ - @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ + @LIBCERROR_LIBADD@ ewf_test_write_SOURCES = \ ewf_test_definitions.h \ ewf_test_getopt.c ewf_test_getopt.h \ ewf_test_libcerror.h \ - ewf_test_libcstring.h \ + ewf_test_libcnotify.h \ ewf_test_libewf.h \ ewf_test_write.c ewf_test_write_LDADD = \ + @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ - @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ + @LIBCERROR_LIBADD@ ewf_test_write_chunk_SOURCES = \ ewf_test_definitions.h \ ewf_test_getopt.c ewf_test_getopt.h \ ewf_test_libcerror.h \ - ewf_test_libcstring.h \ + ewf_test_libcnotify.h \ ewf_test_libewf.h \ ewf_test_write_chunk.c ewf_test_write_chunk_LDADD = \ + @LIBCNOTIFY_LIBADD@ \ ../libewf/libewf.la \ - @LIBCERROR_LIBADD@ \ - @LIBCSTRING_LIBADD@ + @LIBCERROR_LIBADD@ MAINTAINERCLEANFILES = \ Makefile.in diff --git a/tests/ewf_test_glob.c b/tests/ewf_test_glob.c index 48beddc..1931e9f 100644 --- a/tests/ewf_test_glob.c +++ b/tests/ewf_test_glob.c @@ -1,7 +1,7 @@ /* - * Expert Witness Compression Format (EWF) library glob testing program + * library glob testing program * - * Copyright (c) 2006-2012, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -20,6 +20,10 @@ */ #include +#include +#include +#include +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -27,25 +31,26 @@ #include -#include "ewf_test_libcstring.h" #include "ewf_test_libewf.h" /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) - wchar_t **filenames = NULL; +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + wchar_t **filenames = NULL; #else - char **filenames = NULL; + char **filenames = NULL; #endif - libewf_error_t *error = NULL; - int number_of_filenames = 0; - int filename_iterator = 0; + libewf_error_t *error = NULL; + system_character_t *source = NULL; + size_t string_length = 0; + int filename_index = 0; + int number_of_filenames = 0; if( argc < 2 ) { @@ -55,20 +60,23 @@ int main( int argc, char * const argv[] ) return( EXIT_FAILURE ); } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) + source = argv[ 1 ]; + + string_length = system_string_length( + source ); + +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide( - argv[ 1 ], - libcstring_wide_string_length( - argv[ 1 ] ), + source, + string_length, LIBEWF_FORMAT_UNKNOWN, &filenames, &number_of_filenames, &error ) != 1 ) #else if( libewf_glob( - argv[ 1 ], - libcstring_narrow_string_length( - argv[ 1 ] ), + source, + string_length, LIBEWF_FORMAT_UNKNOWN, &filenames, &number_of_filenames, @@ -97,22 +105,22 @@ int main( int argc, char * const argv[] ) return( EXIT_FAILURE ); } - for( filename_iterator = 0; - filename_iterator < number_of_filenames; - filename_iterator++ ) + for( filename_index = 0; + filename_index < number_of_filenames; + filename_index++ ) { -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) fprintf( stdout, "%ls", - filenames[ filename_iterator ] ); + filenames[ filename_index ] ); #else fprintf( stdout, "%s", - filenames[ filename_iterator ] ); + filenames[ filename_index ] ); #endif - if( filename_iterator == ( number_of_filenames - 1 ) ) + if( filename_index == ( number_of_filenames - 1 ) ) { fprintf( stdout, @@ -125,7 +133,7 @@ int main( int argc, char * const argv[] ) " " ); } } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_glob_wide_free( filenames, number_of_filenames, diff --git a/tests/ewf_test_libcstring.h b/tests/ewf_test_libcstring.h deleted file mode 100644 index f81f471..0000000 --- a/tests/ewf_test_libcstring.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The internal libcstring header - * - * Copyright (c) 2006-2012, Joachim Metz - * - * Refer to AUTHORS for acknowledgements. - * - * This software is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this software. If not, see . - */ - -#if !defined( _EWF_TEST_LIBCSTRING_H ) -#define _EWF_TEST_LIBCSTRING_H - -#include - -/* Define HAVE_LOCAL_LIBCSTRING for local use of libcstring - */ -#if defined( HAVE_LOCAL_LIBCSTRING ) - -#include -#include -#include -#include -#include - -#else - -/* If libtool DLL support is enabled set LIBCSTRING_DLL_IMPORT - * before including libcstring.h - */ -#if defined( _WIN32 ) && defined( DLL_IMPORT ) -#define LIBCSTRING_DLL_IMPORT -#endif - -#include - -#endif - -#endif - diff --git a/tests/ewf_test_read.c b/tests/ewf_test_read.c index f38d858..3ec56a8 100644 --- a/tests/ewf_test_read.c +++ b/tests/ewf_test_read.c @@ -30,7 +30,6 @@ #include "ewf_test_definitions.h" #include "ewf_test_libcerror.h" -#include "ewf_test_libcstring.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_read generate verbose output @@ -528,7 +527,7 @@ int ewf_test_read_chunk_at_offset( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -568,7 +567,7 @@ int main( int argc, char * const argv[] ) goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, &( argv[ 1 ] ), diff --git a/tests/ewf_test_read_write.c b/tests/ewf_test_read_write.c index 8f68d27..990536c 100644 --- a/tests/ewf_test_read_write.c +++ b/tests/ewf_test_read_write.c @@ -21,6 +21,10 @@ #include #include +#include +#include +#include +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -31,7 +35,6 @@ #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" -#include "ewf_test_libcstring.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_read_write generate verbose output @@ -610,39 +613,39 @@ int ewf_test_read_write_chunk_at_offset( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { - libcstring_system_character_t *target_filename = NULL; - libcerror_error_t *error = NULL; - libewf_handle_t *handle = NULL; - libcstring_system_integer_t option = 0; - off64_t read_offset = 0; - size64_t media_size = 0; - size64_t read_size = 0; - size32_t chunk_size = 0; - size_t delta_segment_filename_length = 0; + libcerror_error_t *error = NULL; + libewf_handle_t *handle = NULL; + system_character_t *target_filename = NULL; + system_integer_t option = 0; + size64_t media_size = 0; + size64_t read_size = 0; + size32_t chunk_size = 0; + size_t delta_segment_filename_length = 0; + off64_t read_offset = 0; while( ( option = ewf_test_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "t:" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "t:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); - case (libcstring_system_integer_t) 't': + case (system_integer_t) 't': target_filename = optarg; break; @@ -676,7 +679,7 @@ int main( int argc, char * const argv[] ) NULL ); #endif -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, &( argv[ optind ] ), @@ -700,10 +703,10 @@ int main( int argc, char * const argv[] ) } if( target_filename != NULL ) { - delta_segment_filename_length = libcstring_system_string_length( + delta_segment_filename_length = system_string_length( target_filename ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_set_delta_segment_filename_wide( handle, target_filename, diff --git a/tests/ewf_test_read_write_delta.c b/tests/ewf_test_read_write_delta.c index 1c9f2cc..fa369b8 100644 --- a/tests/ewf_test_read_write_delta.c +++ b/tests/ewf_test_read_write_delta.c @@ -21,6 +21,10 @@ #include #include +#include +#include +#include +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -31,7 +35,6 @@ #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" -#include "ewf_test_libcstring.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_read_write_delta generate verbose output @@ -154,7 +157,7 @@ int ewf_test_system_string_decimal_copy_to_64_bit( int ewf_test_read_write_delta( char * const filenames[], int number_of_filenames, - const libcstring_system_character_t *delta_segment_filename, + const system_character_t *delta_segment_filename, off64_t write_offset, size64_t write_size, libcerror_error_t **error ) @@ -188,7 +191,7 @@ int ewf_test_read_write_delta( NULL ); #endif -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, filenames, @@ -215,10 +218,10 @@ int ewf_test_read_write_delta( } if( delta_segment_filename != NULL ) { - delta_segment_filename_length = libcstring_system_string_length( + delta_segment_filename_length = system_string_length( delta_segment_filename ); -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_set_delta_segment_filename_wide( handle, delta_segment_filename, @@ -404,48 +407,48 @@ int ewf_test_read_write_delta( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { - libcstring_system_character_t *option_offset = NULL; - libcstring_system_character_t *option_size = NULL; - libcstring_system_character_t *target_filename = NULL; - libcerror_error_t *error = NULL; - libcstring_system_integer_t option = 0; - off64_t write_offset = 0; - size64_t write_size = 0; - size_t string_length = 0; + libcerror_error_t *error = NULL; + system_character_t *option_offset = NULL; + system_character_t *option_size = NULL; + system_character_t *target_filename = NULL; + system_integer_t option = 0; + size64_t write_size = 0; + size_t string_length = 0; + off64_t write_offset = 0; while( ( option = ewf_test_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "B:o:t:" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "B:o:t:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); - case (libcstring_system_integer_t) 'B': + case (system_integer_t) 'B': option_size = optarg; break; - case (libcstring_system_integer_t) 'o': + case (system_integer_t) 'o': option_offset = optarg; break; - case (libcstring_system_integer_t) 't': + case (system_integer_t) 't': target_filename = optarg; break; @@ -461,7 +464,7 @@ int main( int argc, char * const argv[] ) } if( option_offset != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_offset ); if( ewf_test_system_string_decimal_copy_to_64_bit( @@ -479,7 +482,7 @@ int main( int argc, char * const argv[] ) } if( option_size != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( diff --git a/tests/ewf_test_seek.c b/tests/ewf_test_seek.c index 51fd57d..a4b7c02 100644 --- a/tests/ewf_test_seek.c +++ b/tests/ewf_test_seek.c @@ -28,7 +28,6 @@ #include #include "ewf_test_libcerror.h" -#include "ewf_test_libcstring.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_seek generate verbose output @@ -140,7 +139,7 @@ int ewf_test_seek_offset( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -177,7 +176,7 @@ int main( int argc, char * const argv[] ) goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, &( argv[ 1 ] ), diff --git a/tests/ewf_test_truncate.c b/tests/ewf_test_truncate.c index a287eef..ea89832 100644 --- a/tests/ewf_test_truncate.c +++ b/tests/ewf_test_truncate.c @@ -1,7 +1,7 @@ /* * Expert Witness Compression Format (EWF) library truncate program * - * Copyright (c) 2006-2012, Joachim Metz + * Copyright (C) 2006-2019, Joachim Metz * * Refer to AUTHORS for acknowledgements. * @@ -20,6 +20,10 @@ */ #include +#include +#include +#include +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -27,9 +31,9 @@ #include +#include "ewf_test_libcerror.h" #include "ewf_test_libcfile.h" #include "ewf_test_libcnotify.h" -#include "ewf_test_libcstring.h" /* Copies a string of a decimal value to a 64-bit value * Returns 1 if successful or -1 on error @@ -143,7 +147,7 @@ int ewf_test_system_string_decimal_copy_to_64_bit( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) @@ -170,7 +174,7 @@ int main( int argc, char * const argv[] ) return( EXIT_FAILURE ); } - string_length = libcstring_system_string_length( + string_length = system_string_length( argv[ 1 ] ); if( ewf_test_system_string_decimal_copy_to_64_bit( @@ -195,15 +199,23 @@ int main( int argc, char * const argv[] ) goto on_error; } +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) + if( libcfile_file_open_wide( + file, + argv[ 2 ], + LIBCFILE_OPEN_WRITE, + &error ) != 1 ) +#else if( libcfile_file_open( file, argv[ 2 ], LIBCFILE_OPEN_WRITE, &error ) != 1 ) +#endif { fprintf( stderr, - "Unable to open file: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Unable to open file: %" PRIs_SYSTEM ".\n", argv[ 2 ] ); goto on_error; diff --git a/tests/ewf_test_write.c b/tests/ewf_test_write.c index de7622c..6aea5ef 100644 --- a/tests/ewf_test_write.c +++ b/tests/ewf_test_write.c @@ -21,6 +21,10 @@ #include #include +#include +#include +#include +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -31,7 +35,6 @@ #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" -#include "ewf_test_libcstring.h" #include "ewf_test_libewf.h" /* Define to make ewf_test_write generate verbose output @@ -152,7 +155,7 @@ int ewf_test_system_string_decimal_copy_to_64_bit( * Return 1 if successful, 0 if not or -1 on error */ int ewf_test_write( - const char *filename, + const system_character_t *filename, size64_t media_size, size64_t maximum_segment_size, int8_t compression_level, @@ -179,7 +182,7 @@ int ewf_test_write( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, (wchar_t * const *) &filename, @@ -436,57 +439,57 @@ int ewf_test_write( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { - libcstring_system_character_t *option_chunk_size = NULL; - libcstring_system_character_t *option_compression_level = NULL; - libcstring_system_character_t *option_maximum_segment_size = NULL; - libcstring_system_character_t *option_media_size = NULL; - libcerror_error_t *error = NULL; - libcstring_system_integer_t option = 0; - size64_t chunk_size = 0; - size64_t maximum_segment_size = 0; - size64_t media_size = 0; - size_t string_length = 0; - uint8_t compression_flags = 0; - int8_t compression_level = LIBEWF_COMPRESSION_NONE; + libcerror_error_t *error = NULL; + system_character_t *option_chunk_size = NULL; + system_character_t *option_compression_level = NULL; + system_character_t *option_maximum_segment_size = NULL; + system_character_t *option_media_size = NULL; + system_integer_t option = 0; + size64_t chunk_size = 0; + size64_t maximum_segment_size = 0; + size64_t media_size = 0; + size_t string_length = 0; + uint8_t compression_flags = 0; + int8_t compression_level = LIBEWF_COMPRESSION_NONE; while( ( option = ewf_test_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "b:B:c:S:" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "b:B:c:S:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); - case (libcstring_system_integer_t) 'b': + case (system_integer_t) 'b': option_chunk_size = optarg; break; - case (libcstring_system_integer_t) 'B': + case (system_integer_t) 'B': option_media_size = optarg; break; - case (libcstring_system_integer_t) 'c': + case (system_integer_t) 'c': option_compression_level = optarg; break; - case (libcstring_system_integer_t) 'S': + case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; @@ -509,7 +512,7 @@ int main( int argc, char * const argv[] ) #endif if( option_chunk_size != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_chunk_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( @@ -527,7 +530,7 @@ int main( int argc, char * const argv[] ) } if( option_compression_level != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_compression_level ); if( string_length != 1 ) @@ -538,22 +541,22 @@ int main( int argc, char * const argv[] ) goto on_error; } - if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'n' ) + if( option_compression_level[ 0 ] == (system_character_t) 'n' ) { compression_level = LIBEWF_COMPRESSION_NONE; compression_flags = 0; } - else if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'e' ) + else if( option_compression_level[ 0 ] == (system_character_t) 'e' ) { compression_level = LIBEWF_COMPRESSION_NONE; compression_flags = LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION; } - else if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'f' ) + else if( option_compression_level[ 0 ] == (system_character_t) 'f' ) { compression_level = LIBEWF_COMPRESSION_FAST; compression_flags = 0; } - else if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'b' ) + else if( option_compression_level[ 0 ] == (system_character_t) 'b' ) { compression_level = LIBEWF_COMPRESSION_BEST; compression_flags = 0; @@ -569,7 +572,7 @@ int main( int argc, char * const argv[] ) } if( option_maximum_segment_size != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_maximum_segment_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( @@ -587,7 +590,7 @@ int main( int argc, char * const argv[] ) } if( option_media_size != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_media_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( diff --git a/tests/ewf_test_write_chunk.c b/tests/ewf_test_write_chunk.c index ffdc6a8..c93883a 100644 --- a/tests/ewf_test_write_chunk.c +++ b/tests/ewf_test_write_chunk.c @@ -21,6 +21,10 @@ #include #include +#include +#include +#include +#include #if defined( HAVE_STDLIB_H ) || defined( WINAPI ) #include @@ -31,7 +35,6 @@ #include "ewf_test_definitions.h" #include "ewf_test_getopt.h" #include "ewf_test_libcerror.h" -#include "ewf_test_libcstring.h" #include "ewf_test_libewf.h" /* Copies a string of a decimal value to a 64-bit value @@ -183,7 +186,7 @@ int ewf_test_write_chunk( goto on_error; } -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) if( libewf_handle_open_wide( handle, (wchar_t * const *) &filename, @@ -445,57 +448,57 @@ int ewf_test_write_chunk( /* The main program */ -#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER ) +#if defined( HAVE_WIDE_SYSTEM_CHARACTER ) int wmain( int argc, wchar_t * const argv[] ) #else int main( int argc, char * const argv[] ) #endif { - libcstring_system_character_t *option_chunk_size = NULL; - libcstring_system_character_t *option_compression_level = NULL; - libcstring_system_character_t *option_maximum_segment_size = NULL; - libcstring_system_character_t *option_media_size = NULL; - libcerror_error_t *error = NULL; - libcstring_system_integer_t option = 0; - size64_t chunk_size = 0; - size64_t maximum_segment_size = 0; - size64_t media_size = 0; - size_t string_length = 0; - uint8_t compression_flags = 0; - int8_t compression_level = LIBEWF_COMPRESSION_NONE; + libcerror_error_t *error = NULL; + system_character_t *option_chunk_size = NULL; + system_character_t *option_compression_level = NULL; + system_character_t *option_maximum_segment_size = NULL; + system_character_t *option_media_size = NULL; + system_integer_t option = 0; + size64_t chunk_size = 0; + size64_t maximum_segment_size = 0; + size64_t media_size = 0; + size_t string_length = 0; + uint8_t compression_flags = 0; + int8_t compression_level = LIBEWF_COMPRESSION_NONE; while( ( option = ewf_test_getopt( argc, argv, - _LIBCSTRING_SYSTEM_STRING( "b:B:c:S:" ) ) ) != (libcstring_system_integer_t) -1 ) + _SYSTEM_STRING( "b:B:c:S:" ) ) ) != (system_integer_t) -1 ) { switch( option ) { - case (libcstring_system_integer_t) '?': + case (system_integer_t) '?': default: fprintf( stderr, - "Invalid argument: %" PRIs_LIBCSTRING_SYSTEM ".\n", + "Invalid argument: %" PRIs_SYSTEM ".\n", argv[ optind - 1 ] ); return( EXIT_FAILURE ); - case (libcstring_system_integer_t) 'b': + case (system_integer_t) 'b': option_chunk_size = optarg; break; - case (libcstring_system_integer_t) 'c': + case (system_integer_t) 'c': option_compression_level = optarg; break; - case (libcstring_system_integer_t) 'B': + case (system_integer_t) 'B': option_media_size = optarg; break; - case (libcstring_system_integer_t) 'S': + case (system_integer_t) 'S': option_maximum_segment_size = optarg; break; @@ -511,7 +514,7 @@ int main( int argc, char * const argv[] ) } if( option_chunk_size != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_chunk_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( @@ -529,7 +532,7 @@ int main( int argc, char * const argv[] ) } if( option_compression_level != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_compression_level ); if( string_length != 1 ) @@ -540,22 +543,22 @@ int main( int argc, char * const argv[] ) goto on_error; } - if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'n' ) + if( option_compression_level[ 0 ] == (system_character_t) 'n' ) { compression_level = LIBEWF_COMPRESSION_NONE; compression_flags = 0; } - else if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'e' ) + else if( option_compression_level[ 0 ] == (system_character_t) 'e' ) { compression_level = LIBEWF_COMPRESSION_NONE; compression_flags = LIBEWF_COMPRESS_FLAG_USE_EMPTY_BLOCK_COMPRESSION; } - else if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'f' ) + else if( option_compression_level[ 0 ] == (system_character_t) 'f' ) { compression_level = LIBEWF_COMPRESSION_FAST; compression_flags = 0; } - else if( option_compression_level[ 0 ] == (libcstring_system_character_t) 'b' ) + else if( option_compression_level[ 0 ] == (system_character_t) 'b' ) { compression_level = LIBEWF_COMPRESSION_BEST; compression_flags = 0; @@ -571,7 +574,7 @@ int main( int argc, char * const argv[] ) } if( option_maximum_segment_size != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_maximum_segment_size ); if( ewf_test_system_string_decimal_copy_to_64_bit( @@ -589,7 +592,7 @@ int main( int argc, char * const argv[] ) } if( option_media_size != NULL ) { - string_length = libcstring_system_string_length( + string_length = system_string_length( option_media_size ); if( ewf_test_system_string_decimal_copy_to_64_bit(