Add support for libewf 20160424

This commit is contained in:
Christophe Grenier 2017-03-03 06:51:52 +01:00
parent 269d963cce
commit 1823a008fc
2 changed files with 23 additions and 1 deletions

View file

@ -872,7 +872,7 @@ case "$target" in
;; ;;
esac esac
AC_CHECK_FUNCS([ atexit atoll chdir chmod delscreen dirname dup2 execv fdatasync fseeko fsync ftello ftruncate getcwd geteuid getpwuid lstat memalign memchr memset mkdir posix_fadvise posix_memalign pwrite readlink setenv setlocale sigaction signal sleep snprintf strcasecmp strcasestr strchr strdup strerror strncasecmp strptime strrchr strstr strtol strtoul strtoull touchwin uname utime vsnprintf wctomb ]) AC_CHECK_FUNCS([ atexit atoll chdir chmod delscreen dirname dup2 execv fdatasync fseeko fsync ftello ftruncate getcwd geteuid getpwuid libewf_handle_read_buffer_at_offset libewf_handle_write_buffer_at_offset lstat memalign memchr memset mkdir posix_fadvise posix_memalign pwrite readlink setenv setlocale sigaction signal sleep snprintf strcasecmp strcasestr strchr strdup strerror strncasecmp strptime strrchr strstr strtol strtoul strtoull touchwin uname utime vsnprintf wctomb ])
if test "$ac_cv_func_mkdir" = "no"; then if test "$ac_cv_func_mkdir" = "no"; then
AC_MSG_ERROR(No mkdir function detected) AC_MSG_ERROR(No mkdir function detected)
fi fi

View file

@ -191,7 +191,11 @@ disk_t *fewf_init(const char *device, const int mode)
data->handle, data->handle,
filenames, filenames,
num_files, num_files,
#ifdef LIBEWF_OPEN_READ_WRITE
LIBEWF_OPEN_READ_WRITE, LIBEWF_OPEN_READ_WRITE,
#else
LIBEWF_OPEN_READ | LIBEWF_OPEN_WRITE,
#endif
&ewf_error) != 1 ) &ewf_error) != 1 )
{ {
char buffer[4096]; char buffer[4096];
@ -431,12 +435,21 @@ static int fewf_pread(disk_t *disk, void *buffer, const unsigned int count, cons
struct info_fewf_struct *data=(struct info_fewf_struct *)disk->data; struct info_fewf_struct *data=(struct info_fewf_struct *)disk->data;
int64_t taille; int64_t taille;
#if defined( HAVE_LIBEWF_V2_API ) #if defined( HAVE_LIBEWF_V2_API )
#if defined( HAVE_LIBEWF_HANDLE_READ_BUFFER_AT_OFFSET )
taille = libewf_handle_read_buffer_at_offset(
data->handle,
buffer,
count,
offset,
NULL );
#else
taille = libewf_handle_read_random( taille = libewf_handle_read_random(
data->handle, data->handle,
buffer, buffer,
count, count,
offset, offset,
NULL ); NULL );
#endif
#else #else
taille=libewf_read_random(data->handle, buffer, count, offset); taille=libewf_read_random(data->handle, buffer, count, offset);
#endif #endif
@ -462,12 +475,21 @@ static int fewf_pwrite(disk_t *disk, const void *buffer, const unsigned int coun
struct info_fewf_struct *data=(struct info_fewf_struct *)disk->data; struct info_fewf_struct *data=(struct info_fewf_struct *)disk->data;
int64_t taille; int64_t taille;
#if defined( HAVE_LIBEWF_V2_API ) #if defined( HAVE_LIBEWF_V2_API )
#if defined( HAVE_LIBEWF_HANDLE_WRITE_BUFFER_AT_OFFSET )
taille = libewf_handle_write_buffer_at_offset(
data->handle,
buffer,
count,
offset,
NULL );
#else
taille = libewf_handle_write_random( taille = libewf_handle_write_random(
data->handle, data->handle,
buffer, buffer,
count, count,
offset, offset,
NULL ); NULL );
#endif
#else #else
taille=libewf_write_random(data->handle, buffer, count, offset); taille=libewf_write_random(data->handle, buffer, count, offset);
#endif #endif