Browse Source

Moved libcstring macros to common

tags/20161119
Joachim Metz 3 years ago
parent
commit
32828fbbdc
100 changed files with 3313 additions and 2085 deletions
  1. +9
    -4
      .gitignore
  2. +1
    -0
      .travis.yml
  3. +0
    -3
      Makefile.am
  4. +4
    -1
      common/Makefile.am
  5. +4
    -4
      common/common.h
  6. +186
    -0
      common/narrow_string.h
  7. +151
    -0
      common/system_string.h
  8. +26
    -0
      common/types.h.in
  9. +174
    -0
      common/wide_string.h
  10. +4
    -9
      configure.ac
  11. +1
    -1
      include/libpff/codepage.h
  12. +1
    -1
      include/libpff/definitions.h.in
  13. +13
    -13
      include/libpff/error.h
  14. +5
    -6
      include/libpff/features.h.in
  15. +5
    -5
      include/libpff/types.h.in
  16. +1
    -2
      jpff/Makefile.am
  17. +37
    -37
      jpff/jpff_File.c
  18. +15
    -16
      jpff/jpff_libcerror.h
  19. +0
    -3
      jpff/jpff_string.c
  20. +1
    -0
      libpff.ini
  21. +1
    -1
      libpff.pc.in
  22. +2
    -2
      libpff.spec.in
  23. +0
    -3
      libpff/Makefile.am
  24. +1
    -1
      libpff/libpff.c
  25. +32
    -32
      libpff/libpff_codepage.h
  26. +4
    -3
      libpff/libpff_debug.c
  27. +2
    -3
      libpff/libpff_extern.h
  28. +12
    -5
      libpff/libpff_file.c
  29. +8
    -8
      libpff/libpff_folder.c
  30. +28
    -28
      libpff/libpff_item.c
  31. +9
    -6
      libpff/libpff_name_to_id_map.c
  32. +1
    -1
      libpff/libpff_name_to_id_map.h
  33. +4
    -3
      libpff/libpff_support.c
  34. +12
    -11
      libpff/libpff_table.c
  35. +4
    -4
      libpff/libpff_types.h
  36. +497
    -335
      m4/common.m4
  37. +0
    -304
      m4/libcstring.m4
  38. +2
    -7
      m4/libfwnt.m4
  39. +15
    -23
      m4/types.m4
  40. +2
    -2
      manuals/libpff.3
  41. +7
    -3
      msvscpp/Makefile.am
  42. +12
    -8
      msvscpp/libbfio/libbfio.vcproj
  43. +4
    -8
      msvscpp/libcdata/libcdata.vcproj
  44. +4
    -8
      msvscpp/libcerror/libcerror.vcproj
  45. +12
    -8
      msvscpp/libcfile/libcfile.vcproj
  46. +12
    -8
      msvscpp/libclocale/libclocale.vcproj
  47. +11
    -7
      msvscpp/libcnotify/libcnotify.vcproj
  48. +12
    -8
      msvscpp/libcpath/libcpath.vcproj
  49. +4
    -8
      msvscpp/libcsplit/libcsplit.vcproj
  50. +4
    -12
      msvscpp/libcsystem/libcsystem.vcproj
  51. +4
    -8
      msvscpp/libcthreads/libcthreads.vcproj
  52. +4
    -4
      msvscpp/libfcache/libfcache.vcproj
  53. +4
    -4
      msvscpp/libfdata/libfdata.vcproj
  54. +10
    -6
      msvscpp/libfdatetime/libfdatetime.vcproj
  55. +4
    -8
      msvscpp/libfguid/libfguid.vcproj
  56. +4
    -8
      msvscpp/libfmapi/libfmapi.vcproj
  57. +4
    -8
      msvscpp/libfvalue/libfvalue.vcproj
  58. +4
    -8
      msvscpp/libfwnt/libfwnt.vcproj
  59. +75
    -47
      msvscpp/libpff.sln
  60. +4
    -8
      msvscpp/libpff/libpff.vcproj
  61. +4
    -4
      msvscpp/libuna/libuna.vcproj
  62. +4
    -8
      msvscpp/pff_test_error/pff_test_error.vcproj
  63. +230
    -0
      msvscpp/pff_test_file/pff_test_file.vcproj
  64. +17
    -9
      msvscpp/pff_test_item/pff_test_item.vcproj
  65. +49
    -36
      msvscpp/pff_test_multi_value/pff_test_multi_value.vcproj
  66. +222
    -0
      msvscpp/pff_test_name_to_id_map_entry/pff_test_name_to_id_map_entry.vcproj
  67. +4
    -8
      msvscpp/pff_test_open_close/pff_test_open_close.vcproj
  68. +4
    -8
      msvscpp/pff_test_read_items/pff_test_read_items.vcproj
  69. +222
    -0
      msvscpp/pff_test_record_entry/pff_test_record_entry.vcproj
  70. +19
    -11
      msvscpp/pff_test_record_set/pff_test_record_set.vcproj
  71. +226
    -0
      msvscpp/pff_test_support/pff_test_support.vcproj
  72. +4
    -8
      msvscpp/pffexport/pffexport.vcproj
  73. +4
    -8
      msvscpp/pffinfo/pffinfo.vcproj
  74. +4
    -8
      msvscpp/pypff/pypff.vcproj
  75. +0
    -5
      pfftools/Makefile.am
  76. +562
    -560
      pfftools/export_handle.c
  77. +56
    -57
      pfftools/export_handle.h
  78. +8
    -6
      pfftools/info_handle.c
  79. +2
    -3
      pfftools/info_handle.h
  80. +91
    -89
      pfftools/item_file.c
  81. +10
    -11
      pfftools/item_file.h
  82. +4
    -4
      pfftools/log_handle.c
  83. +1
    -2
      pfftools/log_handle.h
  84. +42
    -40
      pfftools/pffexport.c
  85. +19
    -19
      pfftools/pffinfo.c
  86. +19
    -17
      pfftools/pffinput.c
  87. +1
    -2
      pfftools/pffinput.h
  88. +0
    -51
      pfftools/pfftools_libcstring.h
  89. +1
    -12
      po/ChangeLog
  90. +0
    -3
      pypff-python2/Makefile.am
  91. +0
    -3
      pypff-python3/Makefile.am
  92. +0
    -3
      pypff/Makefile.am
  93. +4
    -4
      pypff/pypff.c
  94. +3
    -3
      pypff/pypff_error.c
  95. +4
    -4
      pypff/pypff_file.c
  96. +0
    -1
      pypff/pypff_file_object_io_handle.c
  97. +0
    -1
      pypff/pypff_file_object_io_handle.h
  98. +0
    -1
      pypff/pypff_folder.c
  99. +0
    -1
      pypff/pypff_item.c
  100. +0
    -1
      pypff/pypff_message.c

+ 9
- 4
.gitignore View File

@@ -1,6 +1,6 @@
# Files to ignore by git
#
# Version: 20160507
# Version: 20161030

# Generic auto-generated build files
*~
@@ -57,6 +57,7 @@ stamp-h[1-9]
/test-driver
/ylwrap
/m4/codeset.m4
/m4/extern-inline.m4
/m4/fcntl-o.m4
/m4/gettext.m4
/m4/glibc2.m4
@@ -125,10 +126,15 @@ stamp-h[1-9]
/pfftools/pffinfo
/tests/input
/tests/pff_test_error
/tests/pff_test_get_version
/tests/pff_test_file
/tests/pff_test_item
/tests/pff_test_multi_value
/tests/pff_test_name_to_id_map_entry
/tests/pff_test_open_close
/tests/pff_test_read_items
/tests/pff_test_set_ascii_codepage
/tests/pff_test_record_entry
/tests/pff_test_record_set
/tests/pff_test_support
/tests/tmp*

# Local library dependencies specific files
@@ -140,7 +146,6 @@ stamp-h[1-9]
/libcnotify
/libcpath
/libcsplit
/libcstring
/libcsystem
/libcthreads
/libfcache

+ 1
- 0
.travis.yml View File

@@ -13,6 +13,7 @@ before_install:
install:
- if test `uname -s` = 'Darwin'; then export SED="/usr/local/bin/gsed"; fi
- ./synclibs.sh && ./autogen.sh
- if test -x 'synctestdata.sh'; then ./synctestdata.sh; fi
script:
- if test `uname -s` = 'Linux'; then export PATH=$(echo $PATH | tr ":" "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s/::/:/g"); fi
- ./runtests.sh

+ 0
- 3
Makefile.am View File

@@ -3,7 +3,6 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
include \
common \
libcstring \
libcerror \
libcthreads \
libcdata \
@@ -84,7 +83,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))
@@ -117,7 +115,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)/libclocale && $(MAKE) splint $(AM_MAKEFLAGS))

+ 4
- 1
common/Makefile.am View File

@@ -9,8 +9,11 @@ EXTRA_DIST = \
config_winapi.h \
file_stream.h \
memory.h \
narrow_string.h \
system_string.h \
types.h \
types.h.in
types.h.in \
wide_string.h

MAINTAINERCLEANFILES = \
Makefile.in

+ 4
- 4
common/common.h View File

@@ -23,21 +23,21 @@
#define _COMMON_H

#if defined( HAVE_CONFIG_H )
#include <config.h>
#include "config.h"
#endif

/* Include the Borland/CodeGear C++ Builder compiler specific configuration
*/
#if defined( __BORLANDC__ )
#include <config_borlandc.h>
#include "config_borlandc.h"

/* Include the Microsoft Visual Studio C++ compiler specific configuration
*/
#elif defined( _MSC_VER )
#include <config_msc.h>
#include "config_msc.h"
#endif

#include <config_winapi.h>
#include "config_winapi.h"

#endif /* !defined( _COMMON_H ) */


+ 186
- 0
common/narrow_string.h View File

@@ -0,0 +1,186 @@
/*
* Narrow character string functions
*
* Copyright (C) 2008-2016, Joachim Metz <joachim.metz@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/

#if !defined( _NARROW_STRING_H )
#define _NARROW_STRING_H

#include "common.h"
#include "memory.h"
#include "types.h"

#if defined( HAVE_GLIB_H )
#include <glib.h>
#endif

#if defined( HAVE_STDLIB_H ) || defined( WINAPI )
#include <stdlib.h>
#endif

#if defined( HAVE_STRING_H ) || defined( WINAPI )
#include <string.h>
#endif

#if defined( __cplusplus )
extern "C" {
#endif

/* String allocation
*/
#define narrow_string_allocate( size ) \
(char *) memory_allocate( sizeof( char ) * ( size ) )

/* String reallocation
*/
#define narrow_string_reallocate( string, size ) \
(char *) memory_reallocate( string, ( sizeof( char ) * ( size ) ) )

/* String length
*/
#if defined( HAVE_STRLEN ) || defined( WINAPI )
#define narrow_string_length( string ) \
strlen( string )
#endif

/* String compare
*/
#if defined( HAVE_MEMCMP ) || defined( WINAPI )
#define narrow_string_compare( string1, string2, size ) \
memcmp( (void *) string1, (void *) string2, size )

#elif defined( HAVE_STRNCMP )
#define narrow_string_compare( string1, string2, size ) \
strncmp( string1, string2, size )
#endif

/* Caseless string compare
*/
#if defined( HAVE_GLIB_H )
#define narrow_string_compare_no_case( string1, string2, size ) \
g_ascii_strncasecmp( string1, string2, size )

#elif defined( _MSC_VER )
#define narrow_string_compare_no_case( string1, string2, size ) \
_strnicmp( string1, string2, size )

#elif defined( WINAPI ) || defined( HAVE_STRNICMP )
#define narrow_string_compare_no_case( string1, string2, size ) \
strnicmp( string1, string2, size )

#elif defined( HAVE_STRNCASECMP )
#define narrow_string_compare_no_case( string1, string2, size ) \
strncasecmp( string1, string2, size )

#elif defined( HAVE_STRCASECMP )
#define narrow_string_compare_no_case( string1, string2, size ) \
strcasecmp( string1, string2 )
#endif

/* String copy
*/
#if defined( HAVE_MEMCPY ) || defined( WINAPI )
#define narrow_string_copy( destination, source, size ) \
(char *) memcpy( (void *) destination, (void *) source, size )

#elif defined( HAVE_STRNCPY )
#define narrow_string_copy( destination, source, size ) \
strncpy( destination, source, size )
#endif

/* String character search
*/
#if defined( HAVE_MEMCHR ) || defined( WINAPI )
#define narrow_string_search_character( string, character, size ) \
(char *) memchr( (void *) string, (int) character, size )

#elif defined( HAVE_STRCHR )
#define narrow_string_search_character( string, character, size ) \
strchr( string, (int) character )
#endif

/* String reverse character search
*/
#if defined( HAVE_MEMRCHR ) && ( HAVE_DECL_MEMRCHR == 1 )
#define narrow_string_search_character_reverse( string, character, size ) \
(char *) memrchr( (void *) string, (int) character, size )

#elif defined( HAVE_STRRCHR ) || defined( WINAPI )
#define narrow_string_search_character_reverse( string, character, size ) \
strrchr( string, (int) character )
#endif

/* String sub-string search
*/
#if defined( HAVE_STRSTR ) || defined( WINAPI )
#define narrow_string_search_string( string, substring, size ) \
strstr( string, substring )
#endif

/* String formatted print (snprintf)
*/
#if defined( HAVE_GLIB_H )
#define narrow_string_snprintf( target, size, ... ) \
g_snprintf( target, size, __VA_ARGS__ )

#elif defined( _MSC_VER )
#define narrow_string_snprintf( target, size, ... ) \
sprintf_s( target, size, __VA_ARGS__ )

#elif defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define narrow_string_snprintf \
snprintf

#elif defined( HAVE_SNPRINTF ) || defined( WINAPI )
#define narrow_string_snprintf( target, size, ... ) \
snprintf( target, size, __VA_ARGS__ )
#endif

/* String input conversion (sscanf)
*/
#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define narrow_string_sscanf \
sscanf

#elif defined( HAVE_SSCANF ) || defined( WINAPI )
#define narrow_string_sscanf( string, format, ... ) \
sscanf( string, format, __VA_ARGS__ )
#endif

/* Variable arguments formatted print to string function (vsnprintf)
*/
#if defined( HAVE_GLIB_H )
#define narrow_string_vsnprintf( string, size, format, ... ) \
g_vsnprintf( string, size, format, __VA_ARGS__ )

#elif defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define narrow_string_vsnprintf \
vsnprintf

#elif defined( HAVE_VSNPRINTF ) || defined( WINAPI )
#define narrow_string_vsnprintf( string, size, format, ... ) \
vsnprintf( string, size, format, __VA_ARGS__ )
#endif

#if defined( __cplusplus )
}
#endif

#endif /* defined( _NARROW_STRING_H ) */


+ 151
- 0
common/system_string.h View File

@@ -0,0 +1,151 @@
/*
* System character string functions
*
* Copyright (C) 2008-2016, Joachim Metz <joachim.metz@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/

#if !defined( _SYSTEM_STRING_H )
#define _SYSTEM_STRING_H

#include "common.h"
#include "narrow_string.h"
#include "types.h"
#include "wide_string.h"

#if defined( _cplusplus )
extern "C" {
#endif

#if defined( HAVE_WIDE_SYSTEM_CHARACTER )

#if SIZEOF_WCHAR_T != 2
#error Unsupported wide system character size
#endif

/* Intermediate version of the macro required
* for correct evaluation predefined string
*/
#define _SYSTEM_STRING_INTERMEDIATE( string ) \
L ## string

#define _SYSTEM_STRING( string ) \
_SYSTEM_STRING_INTERMEDIATE( string )

#define system_string_allocate( size ) \
wide_string_allocate( size )

#define system_string_reallocate( string, size ) \
wide_string_reallocate( string, size )

#define system_string_compare( destination, source, size ) \
wide_string_compare( destination, source, size )

#define system_string_compare_no_case( destination, source, size ) \
wide_string_compare_no_case( destination, source, size )

#define system_string_copy( destination, source, size ) \
wide_string_copy( destination, source, size )

#define system_string_length( string ) \
wide_string_length( string )

#define system_string_search_character( string, character, size ) \
wide_string_search_character( string, character, size )

#define system_string_search_character_reverse( string, character, size ) \
wide_string_search_character_reverse( string, character, size )

#define system_string_search_string( string, substring, size ) \
wide_string_search_string( string, substring, size )

#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define system_string_sprintf \
wide_string_snwprintf

#else
#define system_string_sprintf( string, size, format, ... ) \
wide_string_snwprintf( string, size, format, __VA_ARGS__ )
#endif

#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define system_string_vsprintf \
wide_string_vsnwprintf

#else
#define system_string_vsprintf( string, size, format, ... ) \
wide_string_vsnwprintf( string, size, format, __VA_ARGS__ )
#endif

#else

#define _SYSTEM_STRING( string ) \
string

#define system_string_allocate( size ) \
narrow_string_allocate( size )

#define system_string_reallocate( string, size ) \
narrow_string_reallocate( string, size )

#define system_string_compare( destination, source, size ) \
narrow_string_compare( destination, source, size )

#define system_string_compare_no_case( destination, source, size ) \
narrow_string_compare_no_case( destination, source, size )

#define system_string_copy( destination, source, size ) \
narrow_string_copy( destination, source, size )

#define system_string_length( string ) \
narrow_string_length( string )

#define system_string_search_character( string, character, size ) \
narrow_string_search_character( string, character, size )

#define system_string_search_character_reverse( string, character, size ) \
narrow_string_search_character_reverse( string, character, size )

#define system_string_search_string( string, substring, size ) \
narrow_string_search_string( string, substring, size )

#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define system_string_sprintf \
narrow_string_snprintf

#else
#define system_string_sprintf( string, size, format, ... ) \
narrow_string_snprintf( string, size, format, __VA_ARGS__ )
#endif

#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define system_string_vsprintf \
narrow_string_vsnprintf

#else
#define system_string_vsprintf( string, size, format, ... ) \
narrow_string_vsnprintf( string, size, format, __VA_ARGS__ )
#endif

#endif /* defined( HAVE_WIDE_SYSTEM_CHARACTER ) */

#if defined( _cplusplus )
}
#endif

#endif /* !defined( _SYSTEM_STRING_H ) */


+ 26
- 0
common/types.h.in View File

@@ -33,6 +33,32 @@
*/
#include <@PACKAGE@/types.h>

#if defined( WINAPI ) && ( defined( _UNICODE ) || defined( UNICODE ) )

#define HAVE_WIDE_SYSTEM_CHARACTER 1

/* The system character type is wide
* A system string contains either UTF-16 or UTF-32
*/
typedef wchar_t system_character_t;
typedef wint_t system_integer_t;

#define PRIc_SYSTEM "lc"
#define PRIs_SYSTEM "ls"

#else

/* The system character type is narrow
* A system string contains either UTF-8 or extended ASCII with a codepage
*/
typedef char system_character_t;
typedef int system_integer_t;

#define PRIc_SYSTEM "c"
#define PRIs_SYSTEM "s"

#endif /* defined( WINAPI ) && ( defined( _UNICODE ) || defined( UNICODE ) ) */

/* Fix for systems without PRI definitions
*/
#if !defined( PRId8 )

+ 174
- 0
common/wide_string.h View File

@@ -0,0 +1,174 @@
/*
* Wide character string functions
*
* Copyright (C) 2008-2016, Joachim Metz <joachim.metz@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/

#if !defined( _WIDE_STRING_H )
#define _WIDE_STRING_H

#include "common.h"
#include "memory.h"
#include "types.h"

#if defined( HAVE_WCHAR_H ) || defined( WINAPI )
#include <wchar.h>
#endif

#if defined( __cplusplus )
extern "C" {
#endif

/* Intermediate version of the macro required
* for correct evaluation predefined string
*/
#define _WIDE_STRING_INTERMEDIATE( string ) \
L ## string

#define _WIDE_STRING( string ) \
_WIDE_STRING_INTERMEDIATE( string )

/* String allocation
*/
#define wide_string_allocate( size ) \
(wchar_t *) memory_allocate( sizeof( wchar_t ) * ( size ) )

/* String reallocation
*/
#define wide_string_reallocate( string, size ) \
(wchar_t *) memory_reallocate( string, ( sizeof( wchar_t ) * ( size ) ) )

/* String length
*/
#if defined( HAVE_WCSLEN ) || defined( WINAPI )
#define wide_string_length( string ) \
wcslen( string )
#endif

/* String compare
*/
#if defined( HAVE_WMEMCMP )
#define wide_string_compare( string1, string2, size ) \
wmemcmp( (void *) string1, (void *) string2, size )

#elif defined( HAVE_WCSNCMP ) || defined( WINAPI )
#define wide_string_compare( string1, string2, size ) \
wcsncmp( string1, string2, size )
#endif

/* Caseless string compare
*/
#if defined( _MSC_VER ) || ( defined( __BORLANDC__ ) && ( __BORLANDC__ >= 0x0551 ) )
#define wide_string_compare_no_case( string1, string2, size ) \
_wcsnicmp( string1, string2, size )

#elif defined( WINAPI ) || defined( HAVE_WCSNICMP )
#define wide_string_compare_no_case( string1, string2, size ) \
wcsnicmp( string1, string2, size )

#elif defined( HAVE_WCSNCASECMP )
#define wide_string_compare_no_case( string1, string2, size ) \
wcsncasecmp( string1, string2, size )

#elif defined( HAVE_WCSCASECMP )
#define wide_string_compare_no_case( string1, string2, size ) \
wcscasecmp( string1, string2 )
#endif

/* String copy
*/
#if defined( HAVE_WMEMCPY )
#define wide_string_copy( destination, source, size ) \
(wchar_t *) wmemcpy( (void *) destination, (void *) source, size )

#elif defined( HAVE_WCSNCPY ) || defined( WINAPI )
#define wide_string_copy( destination, source, size ) \
wcsncpy( destination, source, size )
#endif

/* String character search
*/
#if defined( HAVE_WMEMCHR )
#define wide_string_search_character( string, character, size ) \
(wchar_t *) wmemchr( (void *) string, (wchar_t) character, size )

#elif defined( HAVE_WCSCHR ) || defined( WINAPI )
#define wide_string_search_character( string, character, size ) \
wcschr( string, (wchar_t) character )

#endif

/* String reverse character search
*/
#if defined( HAVE_WMEMRCHR )
#define wide_string_search_character_reverse( string, character, size ) \
(wchar_t *) wmemrchr( (void *) string, (wchar_t) character, size )

#elif defined( HAVE_WCSRCHR ) || defined( WINAPI )
#define wide_string_search_character_reverse( string, character, size ) \
wcsrchr( string, (wchar_t) character )
#endif

/* String sub-string search
*/
#if defined( HAVE_WCSSTR ) || defined( WINAPI )
#define wide_string_search_string( string, substring, size ) \
wcsstr( string, substring )

#endif

/* String formatted print (snwprintf)
*/
#if defined( _MSC_VER )
#define wide_string_snwprintf( target, size, ... ) \
swprintf_s( target, size, __VA_ARGS__ )

#elif defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define wide_string_snwprintf \
snwprintf

#elif defined( WINAPI )
#define wide_string_snwprintf( target, size, ... ) \
snwprintf( target, size, __VA_ARGS__ )

#elif defined( HAVE_SWPRINTF )
#define wide_string_snwprintf( target, size, ... ) \
swprintf( target, size, __VA_ARGS__ )
#endif

/* Variable arguments formatted print to string function (vsnwprintf)
*/
#if defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x0560 )
#define wide_string_vsnwprintf \
_vsnwprintf

#elif defined( WINAPI )
#define wide_string_vsnwprintf( string, size, format, ... ) \
_vsnwprintf( string, size, format, __VA_ARGS__ )

#elif defined( HAVE_VSWPRINTF )
#define wide_string_vsnwprintf( string, size, format, ... ) \
vswprintf( string, size, format, __VA_ARGS__ )
#endif

#if defined( __cplusplus )
}
#endif

#endif /* !defined( _WIDE_STRING_H ) */


+ 4
- 9
configure.ac View File

@@ -2,7 +2,7 @@ AC_PREREQ( 2.59 )

AC_INIT(
[libpff],
[20161001],
[20161108],
[joachim.metz@gmail.com])

AC_CONFIG_SRCDIR(
@@ -54,9 +54,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

@@ -93,10 +90,10 @@ AX_LIBFCACHE_CHECK_ENABLE
dnl Check for enabling libfdata for file data types support
AX_LIBFDATA_CHECK_ENABLE

dnl Check for enabling libfdatetime for file date and time support
dnl Check for enabling libfdatetime for date and time formats support
AX_LIBFDATETIME_CHECK_ENABLE

dnl Check for enabling libfguid for file GUID/UUID support
dnl Check for enabling libfguid for GUID/UUID format support
AX_LIBFGUID_CHECK_ENABLE

dnl Check for enabling libfvalue for file value support
@@ -181,7 +178,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_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libfwnt" = xyes || test "x$ac_cv_libfmapi" = xyes || test "x$ac_cv_zlib" != xno],
[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_libfdatetime" = xyes || test "x$ac_cv_libfguid" = xyes || test "x$ac_cv_libfvalue" = xyes || test "x$ac_cv_libfwnt" = xyes || test "x$ac_cv_libfmapi" = xyes || test "x$ac_cv_zlib" != xno],
[AC_SUBST(
[libpff_spec_requires],
[Requires:])
@@ -216,7 +213,6 @@ dnl Have configure make the 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])
@@ -267,7 +263,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

+ 1
- 1
include/libpff/codepage.h View File

@@ -118,5 +118,5 @@ enum LIBPFF_CODEPAGES
}
#endif

#endif
#endif /* !defined( _LIBPFF_CODEPAGE_H ) */


+ 1
- 1
include/libpff/definitions.h.in View File

@@ -186,5 +186,5 @@ enum LIBPFF_ENTRY_VALUE_FLAGS
LIBPFF_ENTRY_VALUE_FLAG_IGNORE_NAME_TO_ID_MAP = 0x02
};

#endif
#endif /* !defined( _LIBPFF_DEFINITIONS_H ) */


+ 13
- 13
include/libpff/error.h View File

@@ -39,7 +39,7 @@ enum LIBPFF_ERROR_DOMAINS
LIBPFF_ERROR_DOMAIN_INPUT = (int) 'i',
LIBPFF_ERROR_DOMAIN_MEMORY = (int) 'm',
LIBPFF_ERROR_DOMAIN_OUTPUT = (int) 'o',
LIBPFF_ERROR_DOMAIN_RUNTIME = (int) 'r',
LIBPFF_ERROR_DOMAIN_RUNTIME = (int) 'r'
};

/* The argument error codes
@@ -208,6 +208,17 @@ enum LIBPFF_MEMORY_ERROR
LIBPFF_MEMORY_ERROR_SET_FAILED = 3
};

/* The output error codes
*/
enum LIBPFF_OUTPUT_ERROR
{
LIBPFF_OUTPUT_ERROR_GENERIC = 0,

/* There is insuficient space to write the output
*/
LIBPFF_OUTPUT_ERROR_INSUFFICIENT_SPACE = 1
};

/* The runtime error codes
* to signify errors regarding runtime processing
*/
@@ -276,16 +287,5 @@ enum LIBPFF_RUNTIME_ERROR
LIBPFF_RUNTIME_ERROR_ABORT_REQUESTED = 15
};

/* The output error codes
*/
enum LIBPFF_OUTPUT_ERROR
{
LIBPFF_OUTPUT_ERROR_GENERIC = 0,

/* There is insuficient space to write the output
*/
LIBPFF_OUTPUT_ERROR_INSUFFICIENT_SPACE = 1
};

#endif
#endif /* !defined( _LIBPFF_ERROR_H ) */


+ 5
- 6
include/libpff/features.h.in View File

@@ -25,12 +25,11 @@
/* The libpff type support features
*/
#if defined( WINAPI ) || @HAVE_WIDE_CHARACTER_TYPE@
#define LIBPFF_HAVE_WIDE_CHARACTER_TYPE 1

/* Old definition kept for compatibility (for now)
*/
#define LIBPFF_WIDE_CHARACTER_TYPE 1
#define LIBPFF_HAVE_WIDE_CHARACTER_TYPE 1
#endif

#if defined( WINAPI ) || @HAVE_MULTI_THREAD_SUPPORT@
#define LIBPFF_HAVE_MULTI_THREAD_SUPPORT 1
#endif

#if defined( HAVE_LIBBFIO ) || ( !defined( WINAPI ) && @HAVE_LIBBFIO@ )
@@ -47,5 +46,5 @@
#endif
#endif

#endif
#endif /* !defined( _LIBPFF_FEATURES_H ) */


+ 5
- 5
include/libpff/types.h.in View File

@@ -187,14 +187,14 @@ typedef int64_t off64_t;
*/
#if !defined( __USE_UNIX98 )
#define __USE_UNIX98
#define LIBCSTRING_DEFINITION_UNIX98
#define LIBPFF_DEFINITION_UNIX98
#endif

#include <wchar.h>

#if defined( LIBCSTRING_DEFINITION_UNIX98 )
#if defined( LIBPFF_DEFINITION_UNIX98 )
#undef __USE_UNIX98
#undef LIBCSTRING_DEFINITION_UNIX98
#undef LIBPFF_DEFINITION_UNIX98
#endif

#endif
@@ -202,9 +202,9 @@ typedef int64_t off64_t;
/* The following type definitions hide internal data structures
*/
typedef intptr_t libpff_file_t;
typedef intptr_t libpff_name_to_id_map_entry_t;
typedef intptr_t libpff_item_t;
typedef intptr_t libpff_multi_value_t;
typedef intptr_t libpff_name_to_id_map_entry_t;
typedef intptr_t libpff_record_entry_t;
typedef intptr_t libpff_record_set_t;

@@ -212,5 +212,5 @@ typedef intptr_t libpff_record_set_t;
}
#endif

#endif
#endif /* !defined( _LIBPFF_TYPES_H ) */


+ 1
- 2
jpff/Makefile.am View File

@@ -10,7 +10,6 @@ if HAVE_JAVA
AM_CFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/common \
@LIBCSTRING_CPPFLAGS@ \
@LIBCERROR_CPPFLAGS@

jardir = @JAR_PACKAGE_DIR@
@@ -31,10 +30,10 @@ BUILT_SOURCES = \
libjpff_la_SOURCES = \
jpff_File.c \
jpff_jni.h \
jpff_libcerror.h \
jpff_string.c jpff_string.h

libjpff_la_LIBADD = \
@LIBCSTRING_LIBADD@ \
@LIBCERROR_LIBADD@ \
../libpff/libpff.la


+ 37
- 37
jpff/jpff_File.c View File

@@ -21,10 +21,9 @@

#include <common.h>
#include <memory.h>
#include <narrow_string.h>
#include <types.h>

#include <libcstring.h>
#include <liberror.h>
#include <wide_string.h>

#if defined( HAVE_STDLIB_H ) || defined( HAVE_WINAPI )
#include <stdlib.h>
@@ -36,6 +35,7 @@

#include "jpff_File.h"
#include "jpff_jni.h"
#include "jpff_libcerror.h"
#include "jpff_string.h"

static jfieldID jpff_File_field_identifier = 0;
@@ -60,10 +60,10 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1initialize(
JNIEnv *environment,
jobject file_object )
{
jclass exception = NULL;
libpff_error_t *pff_error = NULL;
libpff_file_t *pff_file = NULL;
static char *function = "Java_jpff_File_internal_1initialize";
jclass exception = NULL;
libcerror_t *error = NULL;
libpff_file_t *pff_file = NULL;
static char *function = "Java_jpff_File_internal_1initialize";

if( ( environment == NULL )
|| ( *environment == NULL ) )
@@ -95,7 +95,7 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1initialize(
}
if( libpff_file_initialize(
&pff_file,
&pff_error ) != 1 )
&error ) != 1 )
{
exception = jpff_jni_environment_find_class(
environment,
@@ -112,8 +112,8 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1initialize(
exception,
"Java_jpff_File_internal_1initialize: unable to create file" );
}
libpff_error_free(
&pff_error );
libcerror_error_free(
&error );

return;
}
@@ -128,10 +128,10 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1free(
JNIEnv *environment,
jobject file_object )
{
jclass exception = NULL;
libpff_error_t *pff_error = NULL;
libpff_file_t *pff_file = NULL;
static char *function = "Java_jpff_File_internal_1free";
jclass exception = NULL;
libcerror_t *error = NULL;
libpff_file_t *pff_file = NULL;
static char *function = "Java_jpff_File_internal_1free";

if( ( environment == NULL )
|| ( *environment == NULL ) )
@@ -169,12 +169,12 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1free(

if( libpff_file_free(
&pff_file,
&pff_error ) != 1 )
&error ) != 1 )
{
/* TODO something useful with error */

libpff_error_free(
&pff_error );
libcerror_error_free(
&error );

return;
}
@@ -187,11 +187,11 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
jint access_flags )
{
jclass exception = NULL;
libpff_error_t *pff_error = NULL;
libcerror_t *error = NULL;
libpff_file_t *pff_file = NULL;
static char *function = "Java_jpff_File_internal_1open";

#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
wchar_t *wide_filename = NULL;
size_t wide_filename_size = 0;
#else
@@ -245,7 +245,7 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
}
return;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
if( jpff_string_get_wide_string_size(
environment,
filename,
@@ -273,7 +273,7 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
}
return;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
wide_filename = (wchar_t *) memory_allocate(
sizeof( wchar_t ) * wide_filename_size );
#else
@@ -281,7 +281,7 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
sizeof( char ) * narrow_filename_size );
#endif

#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
if( jpff_string_copy_to_wide_string(
environment,
filename,
@@ -309,7 +309,7 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
exception,
"Java_jpff_File_internal_1open: unable to determine narrow filename size" );
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
memory_free(
wide_filename );
#else
@@ -318,18 +318,18 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
#endif
return;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
if( libpff_file_open_wide(
pff_file,
wide_filename,
access_flags,
&pff_error ) != 1 )
&error ) != 1 )
#else
if( libpff_file_open(
pff_file,
narrow_filename,
access_flags,
&pff_error ) != 1 )
&error ) != 1 )
#endif
{
exception = jpff_jni_environment_find_class(
@@ -347,10 +347,10 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
exception,
"Java_jpff_File_internal_1open: unable to open file" );
}
libpff_error_free(
&pff_error );
libcerror_error_free(
&error );

#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
memory_free(
wide_filename );
#else
@@ -359,7 +359,7 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1open(
#endif
return;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
memory_free(
wide_filename );
#else
@@ -372,10 +372,10 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1close(
JNIEnv *environment,
jobject file_object )
{
jclass exception = NULL;
libpff_error_t *pff_error = NULL;
libpff_file_t *pff_file = NULL;
static char *function = "Java_jpff_File_internal_1close";
jclass exception = NULL;
libcerror_t *error = NULL;
libpff_file_t *pff_file = NULL;
static char *function = "Java_jpff_File_internal_1close";

if( ( environment == NULL )
|| ( *environment == NULL ) )
@@ -407,7 +407,7 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1close(
}
if( libpff_file_close(
pff_file,
&pff_error ) != 0 )
&error ) != 0 )
{
exception = jpff_jni_environment_find_class(
environment,
@@ -424,8 +424,8 @@ JNIEXPORT void JNICALL Java_jpff_File_internal_1close(
exception,
"Java_jpff_File_internal_1close: unable to close file" );
}
libpff_error_free(
&pff_error );
libcerror_error_free(
&error );

return;
}

pypff/pypff_libcstring.h → jpff/jpff_libcerror.h View File

@@ -1,5 +1,5 @@
/*
* The internal libcstring header
* The internal libcerror header
*
* Copyright (C) 2008-2016, Joachim Metz <joachim.metz@gmail.com>
*
@@ -19,33 +19,32 @@
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/

#if !defined( _PYPFF_LIBCSTRING_H )
#define _PYPFF_LIBCSTRING_H
#if !defined( _JPFF_LIBCERROR_H )
#define _JPFF_LIBCERROR_H

#include <common.h>

/* Define HAVE_LOCAL_LIBCSTRING for local use of libcstring
/* Define HAVE_LOCAL_LIBCERROR for local use of libcerror
*/
#if defined( HAVE_LOCAL_LIBCSTRING )
#if defined( HAVE_LOCAL_LIBCERROR )

#include <libcstring_definitions.h>
#include <libcstring_narrow_string.h>
#include <libcstring_system_string.h>
#include <libcstring_types.h>
#include <libcstring_wide_string.h>
#include <libcerror_definitions.h>
#include <libcerror_error.h>
#include <libcerror_system.h>
#include <libcerror_types.h>

#else

/* If libtool DLL support is enabled set LIBCSTRING_DLL_IMPORT
* before including libcstring.h
/* If libtool DLL support is enabled set LIBCERROR_DLL_IMPORT
* before including libcerror.h
*/
#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define LIBCSTRING_DLL_IMPORT
#define LIBCERROR_DLL_IMPORT
#endif

#include <libcstring.h>
#include <libcerror.h>

#endif /* defined( HAVE_LOCAL_LIBCSTRING ) */
#endif /* defined( HAVE_LOCAL_LIBCERROR ) */

#endif /* !defined( _PYPFF_LIBCSTRING_H ) */
#endif /* !defined( _JPFF_LIBCERROR_H ) */


+ 0
- 3
jpff/jpff_string.c View File

@@ -22,9 +22,6 @@
#include <common.h>
#include <types.h>

#include <libcstring.h>
#include <liberror.h>

#if defined( HAVE_STDLIB_H ) || defined( HAVE_WINAPI )
#include <stdlib.h>
#endif

+ 1
- 0
libpff.ini View File

@@ -10,6 +10,7 @@ features: ["debug_output", "python"]

[library]
description: "Library to access the Personal Folder File (OST, PAB and PST) format"
public_types: ["file", "name_to_id_map_entry", "item", "multi_value", "record_entry", "record_set"]
build_dependencies: []

[development]

+ 1
- 1
libpff.pc.in View File

@@ -7,6 +7,6 @@ Name: libpff
Description: Library to access the Personal Folder File (OST, PAB and PST) format
Version: @VERSION@
Libs: -L${libdir} -lpff
Libs.private: @ax_libbfio_pc_libs_private@ @ax_libcdata_pc_libs_private@ @ax_libcerror_pc_libs_private@ @ax_libcfile_pc_libs_private@ @ax_libclocale_pc_libs_private@ @ax_libcnotify_pc_libs_private@ @ax_libcpath_pc_libs_private@ @ax_libcsplit_pc_libs_private@ @ax_libcstring_pc_libs_private@ @ax_libcthreads_pc_libs_private@ @ax_libfcache_pc_libs_private@ @ax_libfdata_pc_libs_private@ @ax_libfdatetime_pc_libs_private@ @ax_libfguid_pc_libs_private@ @ax_libfmapi_pc_libs_private@ @ax_libfwnt_pc_libs_private@ @ax_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ @ax_zlib_pc_libs_private@
Libs.private: @ax_libbfio_pc_libs_private@ @ax_libcdata_pc_libs_private@ @ax_libcerror_pc_libs_private@ @ax_libcfile_pc_libs_private@ @ax_libclocale_pc_libs_private@ @ax_libcnotify_pc_libs_private@ @ax_libcpath_pc_libs_private@ @ax_libcsplit_pc_libs_private@ @ax_libcthreads_pc_libs_private@ @ax_libfcache_pc_libs_private@ @ax_libfdata_pc_libs_private@ @ax_libfdatetime_pc_libs_private@ @ax_libfguid_pc_libs_private@ @ax_libfmapi_pc_libs_private@ @ax_libfwnt_pc_libs_private@ @ax_libuna_pc_libs_private@ @ax_pthread_pc_libs_private@ @ax_zlib_pc_libs_private@
Cflags: -I${includedir}


+ 2
- 2
libpff.spec.in View File

@@ -7,8 +7,8 @@ License: LGPL
Source: %{name}-%{version}.tar.gz
URL: https://github.com/libyal/libpff/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@libpff_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_libcsplit_spec_requires@ @ax_libcstring_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfdata_spec_requires@ @ax_libfdatetime_spec_requires@ @ax_libfguid_spec_requires@ @ax_libfmapi_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libfwnt_spec_requires@ @ax_libuna_spec_requires@ @ax_zlib_spec_requires@
@libpff_spec_build_requires@ @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_libcsplit_spec_build_requires@ @ax_libcstring_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfdata_spec_build_requires@ @ax_libfdatetime_spec_build_requires@ @ax_libfguid_spec_build_requires@ @ax_libfmapi_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libfwnt_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@
@libpff_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_libcsplit_spec_requires@ @ax_libcthreads_spec_requires@ @ax_libfdata_spec_requires@ @ax_libfdatetime_spec_requires@ @ax_libfguid_spec_requires@ @ax_libfmapi_spec_requires@ @ax_libfvalue_spec_requires@ @ax_libfwnt_spec_requires@ @ax_libuna_spec_requires@ @ax_zlib_spec_requires@
@libpff_spec_build_requires@ @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_libcsplit_spec_build_requires@ @ax_libcthreads_spec_build_requires@ @ax_libfdata_spec_build_requires@ @ax_libfdatetime_spec_build_requires@ @ax_libfguid_spec_build_requires@ @ax_libfmapi_spec_build_requires@ @ax_libfvalue_spec_build_requires@ @ax_libfwnt_spec_build_requires@ @ax_libuna_spec_build_requires@ @ax_zlib_spec_build_requires@

%description
libpff is a library to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format. PFF is used in PAB (Personal Address Book), PST (Personal Storage Table) and OST (Offline Storage Table) files.

+ 0
- 3
libpff/Makefile.am View File

@@ -1,7 +1,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/common \
@LIBCSTRING_CPPFLAGS@ \
@LIBCERROR_CPPFLAGS@ \
@LIBCTHREADS_CPPFLAGS@ \
@LIBCDATA_CPPFLAGS@ \
@@ -61,7 +60,6 @@ libpff_la_SOURCES = \
libpff_libcerror.h \
libpff_libclocale.h \
libpff_libcnotify.h \
libpff_libcstring.h \
libpff_libfcache.h \
libpff_libfdata.h \
libpff_libfguid.h \
@@ -101,7 +99,6 @@ libpff_la_SOURCES = \
pff_value_data.h

libpff_la_LIBADD = \
@LIBCSTRING_LIBADD@ \
@LIBCERROR_LIBADD@ \
@LIBCTHREADS_LIBADD@ \
@LIBCDATA_LIBADD@ \

+ 1
- 1
libpff/libpff.c View File

@@ -51,7 +51,7 @@ BOOL WINAPI DllMain(
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(
hinstDLL );
break;
break;

case DLL_THREAD_ATTACH:
break;

+ 32
- 32
libpff/libpff_codepage.h View File

@@ -43,41 +43,41 @@ extern "C" {
*/
enum LIBPFF_CODEPAGES
{
LIBPFF_CODEPAGE_ASCII = 20127,
LIBPFF_CODEPAGE_ASCII = 20127,

LIBPFF_CODEPAGE_ISO_8859_1 = 28591,
LIBPFF_CODEPAGE_ISO_8859_2 = 28592,
LIBPFF_CODEPAGE_ISO_8859_3 = 28593,
LIBPFF_CODEPAGE_ISO_8859_4 = 28594,
LIBPFF_CODEPAGE_ISO_8859_5 = 28595,
LIBPFF_CODEPAGE_ISO_8859_6 = 28596,
LIBPFF_CODEPAGE_ISO_8859_7 = 28597,
LIBPFF_CODEPAGE_ISO_8859_8 = 28598,
LIBPFF_CODEPAGE_ISO_8859_9 = 28599,
LIBPFF_CODEPAGE_ISO_8859_10 = 28600,
LIBPFF_CODEPAGE_ISO_8859_11 = 28601,
LIBPFF_CODEPAGE_ISO_8859_13 = 28603,
LIBPFF_CODEPAGE_ISO_8859_14 = 28604,
LIBPFF_CODEPAGE_ISO_8859_15 = 28605,
LIBPFF_CODEPAGE_ISO_8859_16 = 28606,
LIBPFF_CODEPAGE_ISO_8859_1 = 28591,
LIBPFF_CODEPAGE_ISO_8859_2 = 28592,
LIBPFF_CODEPAGE_ISO_8859_3 = 28593,
LIBPFF_CODEPAGE_ISO_8859_4 = 28594,
LIBPFF_CODEPAGE_ISO_8859_5 = 28595,
LIBPFF_CODEPAGE_ISO_8859_6 = 28596,
LIBPFF_CODEPAGE_ISO_8859_7 = 28597,
LIBPFF_CODEPAGE_ISO_8859_8 = 28598,
LIBPFF_CODEPAGE_ISO_8859_9 = 28599,
LIBPFF_CODEPAGE_ISO_8859_10 = 28600,
LIBPFF_CODEPAGE_ISO_8859_11 = 28601,
LIBPFF_CODEPAGE_ISO_8859_13 = 28603,
LIBPFF_CODEPAGE_ISO_8859_14 = 28604,
LIBPFF_CODEPAGE_ISO_8859_15 = 28605,
LIBPFF_CODEPAGE_ISO_8859_16 = 28606,

LIBPFF_CODEPAGE_KOI8_R = 20866,
LIBPFF_CODEPAGE_KOI8_U = 21866,
LIBPFF_CODEPAGE_KOI8_R = 20866,
LIBPFF_CODEPAGE_KOI8_U = 21866,

LIBPFF_CODEPAGE_WINDOWS_874 = 874,
LIBPFF_CODEPAGE_WINDOWS_932 = 932,
LIBPFF_CODEPAGE_WINDOWS_936 = 936,
LIBPFF_CODEPAGE_WINDOWS_949 = 949,
LIBPFF_CODEPAGE_WINDOWS_950 = 950,
LIBPFF_CODEPAGE_WINDOWS_1250 = 1250,
LIBPFF_CODEPAGE_WINDOWS_1251 = 1251,
LIBPFF_CODEPAGE_WINDOWS_1252 = 1252,
LIBPFF_CODEPAGE_WINDOWS_1253 = 1253,
LIBPFF_CODEPAGE_WINDOWS_1254 = 1254,
LIBPFF_CODEPAGE_WINDOWS_1255 = 1255,
LIBPFF_CODEPAGE_WINDOWS_1256 = 1256,
LIBPFF_CODEPAGE_WINDOWS_1257 = 1257,
LIBPFF_CODEPAGE_WINDOWS_1258 = 1258
LIBPFF_CODEPAGE_WINDOWS_874 = 874,
LIBPFF_CODEPAGE_WINDOWS_932 = 932,
LIBPFF_CODEPAGE_WINDOWS_936 = 936,
LIBPFF_CODEPAGE_WINDOWS_949 = 949,
LIBPFF_CODEPAGE_WINDOWS_950 = 950,
LIBPFF_CODEPAGE_WINDOWS_1250 = 1250,
LIBPFF_CODEPAGE_WINDOWS_1251 = 1251,
LIBPFF_CODEPAGE_WINDOWS_1252 = 1252,
LIBPFF_CODEPAGE_WINDOWS_1253 = 1253,
LIBPFF_CODEPAGE_WINDOWS_1254 = 1254,
LIBPFF_CODEPAGE_WINDOWS_1255 = 1255,
LIBPFF_CODEPAGE_WINDOWS_1256 = 1256,
LIBPFF_CODEPAGE_WINDOWS_1257 = 1257,
LIBPFF_CODEPAGE_WINDOWS_1258 = 1258
};

#endif /* !defined( HAVE_LOCAL_LIBPFF ) */

+ 4
- 3
libpff/libpff_debug.c View File

@@ -23,6 +23,7 @@
#include <byte_stream.h>
#include <file_stream.h>
#include <memory.h>
#include <system_string.h>
#include <types.h>

#include "libpff_debug.h"
@@ -475,7 +476,7 @@ int libpff_debug_name_to_id_map_value_print(
int ascii_codepage,
libcerror_error_t **error )
{
libcstring_system_character_t guid_string[ 48 ];
system_character_t guid_string[ 48 ];

libfguid_identifier_t *guid = NULL;
static char *function = "libpff_debug_name_to_id_map_value_print";
@@ -555,7 +556,7 @@ int libpff_debug_name_to_id_map_value_print(

goto on_error;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libfguid_identifier_copy_to_utf16_string(
guid,
(uint16_t *) guid_string,
@@ -582,7 +583,7 @@ int libpff_debug_name_to_id_map_value_print(
goto on_error;
}
libcnotify_printf(
"Class identifier: %02" PRIu32 "\t: %" PRIs_LIBCSTRING_SYSTEM " (%s)\n",
"Class identifier: %02" PRIu32 "\t: %" PRIs_SYSTEM " (%s)\n",
value_iterator,
guid_string,
libfmapi_class_identifier_get_name(

+ 2
- 3
libpff/libpff_extern.h View File

@@ -38,10 +38,9 @@
#include <libpff/extern.h>

#else

#define LIBPFF_EXTERN extern
#define LIBPFF_EXTERN extern

#endif

#endif
#endif /* !defined( _LIBPFF_INTERNAL_EXTERN_H ) */


+ 12
- 5
libpff/libpff_file.c View File

@@ -21,7 +21,9 @@

#include <common.h>
#include <memory.h>
#include <narrow_string.h>
#include <types.h>
#include <wide_string.h>

#include "libpff_codepage.h"
#include "libpff_debug.h"
@@ -37,7 +39,6 @@
#include "libpff_libcdata.h"
#include "libpff_libcerror.h"
#include "libpff_libcnotify.h"
#include "libpff_libcstring.h"
#include "libpff_libfdata.h"
#include "libpff_name_to_id_map.h"
#include "libpff_offsets_index.h"
@@ -245,6 +246,7 @@ int libpff_file_open(
libbfio_handle_t *file_io_handle = NULL;
libpff_internal_file_t *internal_file = NULL;
static char *function = "libpff_file_open";
size_t filename_length = 0;

if( file == NULL )
{
@@ -299,11 +301,13 @@ int libpff_file_open(
goto on_error;
}
#endif
filename_length = narrow_string_length(
filename );

if( libbfio_file_set_name(
file_io_handle,
filename,
libcstring_narrow_string_length(
filename ) + 1,
filename_length + 1,
error ) != 1 )
{
libcerror_error_set(
@@ -359,6 +363,7 @@ int libpff_file_open_wide(
libbfio_handle_t *file_io_handle = NULL;
libpff_internal_file_t *internal_file = NULL;
static char *function = "libpff_file_open_wide";
size_t filename_length = 0;

if( file == NULL )
{
@@ -413,11 +418,13 @@ int libpff_file_open_wide(
goto on_error;
}
#endif
filename_length = wide_string_length(
filename );

if( libbfio_file_set_name_wide(
file_io_handle,
filename,
libcstring_wide_string_length(
filename ) + 1,
filename_length + 1,
error ) != 1 )
{
libcerror_error_set(

+ 8
- 8
libpff/libpff_folder.c View File

@@ -21,6 +21,7 @@

#include <common.h>
#include <memory.h>
#include <narrow_string.h>
#include <types.h>

#include "libpff_debug.h"
@@ -35,7 +36,6 @@
#include "libpff_libcdata.h"
#include "libpff_libcerror.h"
#include "libpff_libcnotify.h"
#include "libpff_libcstring.h"
#include "libpff_libfcache.h"
#include "libpff_libfdata.h"
#include "libpff_libfmapi.h"
@@ -146,7 +146,7 @@ int libpff_folder_get_type(
}
if( container_class_string_size > 0 )
{
container_class_string = libcstring_narrow_string_allocate(
container_class_string = narrow_string_allocate(
container_class_string_size );

if( container_class_string == NULL )
@@ -177,14 +177,14 @@ int libpff_folder_get_type(
}
if( container_class_string_size == 9 )
{
if( libcstring_narrow_string_compare(
if( narrow_string_compare(
container_class_string,
"IPF.Note",
8 ) == 0 )
{
folder_type = LIBPFF_ITEM_TYPE_EMAIL;
}
else if( libcstring_narrow_string_compare(
else if( narrow_string_compare(
container_class_string,
"IPF.Task",
8 ) == 0 )
@@ -194,14 +194,14 @@ int libpff_folder_get_type(
}
else if( container_class_string_size == 12 )
{
if( libcstring_narrow_string_compare(
if( narrow_string_compare(
container_class_string,
"IPF.Contact",
11 ) == 0 )
{
folder_type = LIBPFF_ITEM_TYPE_CONTACT;
}
else if( libcstring_narrow_string_compare(
else if( narrow_string_compare(
container_class_string,
"IPF.Journal",
11 ) == 0 )
@@ -211,14 +211,14 @@ int libpff_folder_get_type(
}
else if( container_class_string_size == 16 )
{
if( libcstring_narrow_string_compare(
if( narrow_string_compare(
container_class_string,
"IPF.Appointment",
15 ) == 0 )
{
folder_type = LIBPFF_ITEM_TYPE_APPOINTMENT;
}
else if( libcstring_narrow_string_compare(
else if( narrow_string_compare(
container_class_string,
"IPF.StickyNote",
15 ) == 0 )

+ 28
- 28
libpff/libpff_item.c View File

@@ -22,6 +22,7 @@
#include <common.h>
#include <byte_stream.h>
#include <memory.h>
#include <narrow_string.h>
#include <types.h>

#include "libpff_debug.h"
@@ -35,7 +36,6 @@
#include "libpff_libcdata.h"
#include "libpff_libcerror.h"
#include "libpff_libcnotify.h"
#include "libpff_libcstring.h"
#include "libpff_libfcache.h"
#include "libpff_libfdata.h"
#include "libpff_libfmapi.h"
@@ -550,7 +550,7 @@ int libpff_item_determine_type(
}
if( item_type_string_size > 0 )
{
item_type_string = libcstring_narrow_string_allocate(
item_type_string = narrow_string_allocate(
item_type_string_size );

if( item_type_string == NULL )
@@ -582,7 +582,7 @@ int libpff_item_determine_type(
}
if( item_type_string_size == 4 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM",
3 ) == 0 )
@@ -592,7 +592,7 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 8 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.FAX",
7 ) == 0 )
@@ -602,21 +602,21 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 9 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Note",
8 ) == 0 )
{
internal_item->type = LIBPFF_ITEM_TYPE_EMAIL;
}
else if( libcstring_narrow_string_compare_no_case(
else if( narrow_string_compare_no_case(
item_type_string,
"IPM.Post",
8 ) == 0 )
{
internal_item->type = LIBPFF_ITEM_TYPE_POSTING_NOTE;
}
else if( libcstring_narrow_string_compare_no_case(
else if( narrow_string_compare_no_case(
item_type_string,
"IPM.Task",
8 ) == 0 )
@@ -626,7 +626,7 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 12 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Contact",
11 ) == 0 )
@@ -636,28 +636,28 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 13 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Activity",
12 ) == 0 )
{
internal_item->type = LIBPFF_ITEM_TYPE_ACTIVITY;
}
else if( libcstring_narrow_string_compare_no_case(
else if( narrow_string_compare_no_case(
item_type_string,
"IPM.DistList",
12 ) == 0 )
{
internal_item->type = LIBPFF_ITEM_TYPE_DISTRIBUTION_LIST;
}
else if( libcstring_narrow_string_compare_no_case(
else if( narrow_string_compare_no_case(
item_type_string,
"IPM.Note.Fax",
12 ) == 0 )
{
internal_item->type = LIBPFF_ITEM_TYPE_FAX;
}
else if( libcstring_narrow_string_compare_no_case(
else if( narrow_string_compare_no_case(
item_type_string,
"IPM.Post.RSS",
12 ) == 0 )
@@ -667,7 +667,7 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 15 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.StickyNote",
15 ) == 0 )
@@ -677,7 +677,7 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 16 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Appointment",
15 ) == 0 )
@@ -687,7 +687,7 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 19 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Note.Voicemail",
18 ) == 0 )
@@ -697,14 +697,14 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 20 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Note.Mobile.SMS",
19 ) == 0 )
{
internal_item->type = LIBPFF_ITEM_TYPE_SMS;
}
else if( libcstring_narrow_string_compare_no_case(
else if( narrow_string_compare_no_case(
item_type_string,
"IPM.Note.Mobile.MMS",
19 ) == 0 )
@@ -714,7 +714,7 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 21 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Conflict.Message",
20 ) == 0 )
@@ -724,7 +724,7 @@ int libpff_item_determine_type(
}
else if( item_type_string_size == 53 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}",
52 ) == 0 )
@@ -736,7 +736,7 @@ int libpff_item_determine_type(
{
if( item_type_string_size >= 12 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Sharing",
11 ) == 0 )
@@ -749,7 +749,7 @@ int libpff_item_determine_type(
{
if( item_type_string_size >= 13 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Document",
12 ) == 0 )
@@ -762,7 +762,7 @@ int libpff_item_determine_type(
{
if( item_type_string_size >= 15 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Note.SMIME",
14 ) == 0 )
@@ -775,14 +775,14 @@ int libpff_item_determine_type(
{
if( item_type_string_size >= 16 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.TaskRequest",
15 ) == 0 )
{
internal_item->type = LIBPFF_ITEM_TYPE_TASK_REQUEST;
}
else if( libcstring_narrow_string_compare_no_case(
else if( narrow_string_compare_no_case(
item_type_string,
"REPORT.IPM.Note",
15 ) == 0 )
@@ -795,7 +795,7 @@ int libpff_item_determine_type(
{
if( item_type_string_size >= 18 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Configuration",
17 ) == 0 )
@@ -808,7 +808,7 @@ int libpff_item_determine_type(
{
if( item_type_string_size >= 21 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Schedule.Meeting",
20 ) == 0 )
@@ -821,7 +821,7 @@ int libpff_item_determine_type(
{
if( item_type_string_size >= 28 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"REPORT.IPM.Schedule.Meeting",
27 ) == 0 )
@@ -837,7 +837,7 @@ int libpff_item_determine_type(
*/
if( item_type_string_size >= 10 )
{
if( libcstring_narrow_string_compare_no_case(
if( narrow_string_compare_no_case(
item_type_string,
"IPM.Note.",
9 ) == 0 )

+ 9
- 6
libpff/libpff_name_to_id_map.c View File

@@ -22,7 +22,10 @@
#include <common.h>
#include <byte_stream.h>
#include <memory.h>
#include <narrow_string.h>
#include <system_string.h>
#include <types.h>
#include <wide_string.h>

#include "libpff_codepage.h"
#include "libpff_debug.h"
@@ -860,7 +863,7 @@ int libpff_name_to_id_map_entry_read(
{
if( internal_name_to_id_map_entry->is_ascii_string == 0 )
{
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libuna_utf16_string_size_from_utf16_stream(
internal_name_to_id_map_entry->string_value,
internal_name_to_id_map_entry->value_size,
@@ -878,7 +881,7 @@ int libpff_name_to_id_map_entry_read(
}
else
{
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libuna_utf8_string_size_from_byte_stream(
internal_name_to_id_map_entry->string_value,
internal_name_to_id_map_entry->value_size,
@@ -905,7 +908,7 @@ int libpff_name_to_id_map_entry_read(

goto on_error;
}
internal_name_to_id_map_entry->debug_string = libcstring_system_string_allocate(
internal_name_to_id_map_entry->debug_string = system_string_allocate(
internal_name_to_id_map_entry->debug_string_size );

if( internal_name_to_id_map_entry->debug_string == NULL )
@@ -921,7 +924,7 @@ int libpff_name_to_id_map_entry_read(
}
if( internal_name_to_id_map_entry->is_ascii_string == 0 )
{
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libuna_utf16_string_copy_from_utf16_stream(
(libuna_utf16_character_t *) internal_name_to_id_map_entry->debug_string,
internal_name_to_id_map_entry->debug_string_size,
@@ -941,7 +944,7 @@ int libpff_name_to_id_map_entry_read(
}
else
{
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libuna_utf16_string_copy_from_byte_stream(
(libuna_utf16_character_t *) internal_name_to_id_map_entry->debug_string,
internal_name_to_id_map_entry->debug_string_size,
@@ -971,7 +974,7 @@ int libpff_name_to_id_map_entry_read(
goto on_error;
}
libcnotify_printf(
"%s: entry: %03d name to id map entry string\t: %" PRIs_LIBCSTRING_SYSTEM "\n",
"%s: entry: %03d name to id map entry string\t: %" PRIs_SYSTEM "\n",
function,
name_to_id_map_entry_index,
internal_name_to_id_map_entry->debug_string );

+ 1
- 1
libpff/libpff_name_to_id_map.h View File

@@ -81,7 +81,7 @@ struct libpff_internal_name_to_id_map_entry
#if defined( HAVE_DEBUG_OUTPUT )
/* The debug string value
*/
libcstring_system_character_t *debug_string;
system_character_t *debug_string;

/* The debug string size
*/

+ 4
- 3
libpff/libpff_support.c View File

@@ -21,14 +21,15 @@

#include <common.h>
#include <memory.h>
#include <narrow_string.h>
#include <types.h>
#include <wide_string.h>

#include "libpff_definitions.h"
#include "libpff_io_handle.h"
#include "libpff_libbfio.h"
#include "libpff_libcerror.h"
#include "libpff_libclocale.h"
#include "libpff_libcstring.h"
#include "libpff_support.h"

#if !defined( HAVE_LOCAL_LIBPFF )
@@ -126,7 +127,7 @@ int libpff_check_file_signature(

return( -1 );
}
filename_length = libcstring_narrow_string_length(
filename_length = narrow_string_length(
filename );

if( filename_length == 0 )
@@ -233,7 +234,7 @@ int libpff_check_file_signature_wide(

return( -1 );
}
filename_length = libcstring_wide_string_length(
filename_length = wide_string_length(
filename );

if( filename_length == 0 )

+ 12
- 11
libpff/libpff_table.c View File

@@ -22,6 +22,7 @@
#include <common.h>
#include <byte_stream.h>
#include <memory.h>
#include <system_string.h>
#include <types.h>

#include "libpff_column_definition.h"
@@ -2892,7 +2893,7 @@ int libpff_table_read_record_entries(
int record_entry_index = 0;

#if defined( HAVE_DEBUG_OUTPUT )
libcstring_system_character_t guid_string[ 48 ];
system_character_t guid_string[ 48 ];

libfguid_identifier_t *guid = NULL;
uint64_t record_entry_identifier = 0;
@@ -3113,7 +3114,7 @@ int libpff_table_read_record_entries(

goto on_error;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libfguid_identifier_copy_to_utf16_string(
guid,
(uint16_t *) guid_string,
@@ -3153,7 +3154,7 @@ int libpff_table_read_record_entries(
goto on_error;
}
libcnotify_printf(
"%s: record entry: %03d at level: %" PRIu8 " identifier\t\t\t: %" PRIs_LIBCSTRING_SYSTEM "s\n",
"%s: record entry: %03d at level: %" PRIu8 " identifier\t\t\t: %" PRIs_SYSTEM "s\n",
function,
record_entry_index,
record_entries_level,
@@ -5184,7 +5185,7 @@ int libpff_table_read_6c_record_entries(
int record_entry_index = 0;

#if defined( HAVE_DEBUG_OUTPUT )
libcstring_system_character_t guid_string[ 48 ];
system_character_t guid_string[ 48 ];

libfguid_identifier_t *guid = NULL;
int result = 0;
@@ -5519,7 +5520,7 @@ int libpff_table_read_6c_record_entries(

goto on_error;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libfguid_identifier_copy_to_utf16_string(
guid,
(uint16_t *) guid_string,
@@ -5546,7 +5547,7 @@ int libpff_table_read_6c_record_entries(
goto on_error;
}
libcnotify_printf(
"%s: table set: %03d entry: %03d record entry guid\t\t\t: %" PRIs_LIBCSTRING_SYSTEM "\n",
"%s: table set: %03d entry: %03d record entry guid\t\t\t: %" PRIs_SYSTEM "\n",
function,
0,
record_entry_index,
@@ -5568,7 +5569,7 @@ int libpff_table_read_6c_record_entries(

goto on_error;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libfguid_identifier_copy_to_utf16_string(
guid,
(uint16_t *) guid_string,
@@ -5608,7 +5609,7 @@ int libpff_table_read_6c_record_entries(
goto on_error;
}
libcnotify_printf(
"%s: table set: %03d entry: %03d record entry value guid\t\t: %" PRIs_LIBCSTRING_SYSTEM "\n",
"%s: table set: %03d entry: %03d record entry value guid\t\t: %" PRIs_SYSTEM "\n",
function,
0,
record_entry_index,
@@ -6229,7 +6230,7 @@ int libpff_table_read_9c_record_entries(
int record_entry_index = 0;

#if defined( HAVE_DEBUG_OUTPUT )
libcstring_system_character_t guid_string[ 48 ];
system_character_t guid_string[ 48 ];

libfguid_identifier_t *guid = NULL;
uint32_t value_32bit = 0;
@@ -6495,7 +6496,7 @@ int libpff_table_read_9c_record_entries(

goto on_error;
}
#if defined( LIBCSTRING_HAVE_WIDE_SYSTEM_CHARACTER )
#if defined( HAVE_WIDE_SYSTEM_CHARACTER )
result = libfguid_identifier_copy_to_utf16_string(
guid,
(uint16_t *) guid_string,
@@ -6535,7 +6536,7 @@ int libpff_table_read_9c_record_entries(
goto on_error;
}
libcnotify_printf(
"%s: table set: %03d entry: %03d record entry guid\t\t\t: %" PRIs_LIBCSTRING_SYSTEM "\n",
"%s: table set: %03d entry: %03d record entry guid\t\t\t: %" PRIs_SYSTEM "\n",
function,
0,
record_entry_index,

+ 4
- 4
libpff/libpff_types.h View File

@@ -35,21 +35,21 @@
*/
#if defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI )
typedef struct libpff_file {} libpff_file_t;
typedef struct libpff_name_to_id_map_entry{} libpff_name_to_id_map_entry_t;
typedef struct libpff_item {} libpff_item_t;
typedef struct libpff_multi_value {} libpff_multi_value_t;
typedef struct libpff_name_to_id_map_entry {} libpff_name_to_id_map_entry_t;
typedef struct libpff_record_entry {} libpff_record_entry_t;
typedef struct libpff_record_set {} libpff_record_set_t;

#else
typedef intptr_t libpff_file_t;
typedef intptr_t libpff_name_to_id_map_entry_t;
typedef intptr_t libpff_item_t;
typedef intptr_t libpff_multi_value_t;
typedef intptr_t libpff_name_to_id_map_entry_t;
typedef intptr_t libpff_record_entry_t;
typedef intptr_t libpff_record_set_t;

#endif
#endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */

#endif /* defined( HAVE_LOCAL_LIBPFF ) */

@@ -58,5 +58,5 @@ typedef intptr_t libpff_record_set_t;
*/
typedef unsigned long int libpff_aligned_t;

#endif /* defined( HAVE_DEBUG_OUTPUT ) && !defined( WINAPI ) */
#endif /* !defined( _LIBPFF_INTE